AWViz-ROS
Loading...
Searching...
No Matches
test_utility.hpp
Go to the documentation of this file.
1// Copyright 2024 Kotaro Uetake.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#ifndef AWVIZ_COMMON__TEST__TRANSFORMATION__TEST_UTILITY_HPP_
16#define AWVIZ_COMMON__TEST__TRANSFORMATION__TEST_UTILITY_HPP_
17
18#include <rclcpp/rclcpp.hpp>
19
20#include <geometry_msgs/msg/transform_stamped.hpp>
21
22#include <string>
23
24inline geometry_msgs::msg::TransformStamped make_transform(
25 const std::string & parent, const std::string & child, const rclcpp::Time & stamp)
26{
27 geometry_msgs::msg::TransformStamped tf;
28 tf.header.stamp = stamp;
29 tf.header.frame_id = parent;
30 tf.child_frame_id = child;
31 tf.transform.translation.x = 1.0;
32 tf.transform.translation.y = 2.0;
33 tf.transform.translation.z = 3.0;
34 tf.transform.rotation.w = 1.0;
35 tf.transform.rotation.x = 0.0;
36 tf.transform.rotation.y = 0.0;
37 tf.transform.rotation.z = 0.0;
38 return tf;
39}
40
41#endif
geometry_msgs::msg::TransformStamped make_transform(const std::string &parent, const std::string &child, const rclcpp::Time &stamp)
Definition: test_utility.hpp:24