sick_tf_publisher.h
Go to the documentation of this file.
1 #include "sick_scan/sick_scan_base.h" /* Base definitions included in all header files, added by add_sick_scan_base_header.py. Do not edit this line. */
2 /*
3  * Copyright (C) 2024, Ing.-Buero Dr. Michael Lehning, Hildesheim
4  * Copyright (C) 2024, SICK AG, Waldkirch
5  * All rights reserved.
6  *
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 *
19 *
20 * All rights reserved.
21 *
22 * Redistribution and use in source and binary forms, with or without
23 * modification, are permitted provided that the following conditions are met:
24 *
25 * * Redistributions of source code must retain the above copyright
26 * notice, this list of conditions and the following disclaimer.
27 * * Redistributions in binary form must reproduce the above copyright
28 * notice, this list of conditions and the following disclaimer in the
29 * documentation and/or other materials provided with the distribution.
30 * * Neither the name of Osnabrueck University nor the names of its
31 * contributors may be used to endorse or promote products derived from
32 * this software without specific prior written permission.
33 * * Neither the name of SICK AG nor the names of its
34 * contributors may be used to endorse or promote products derived from
35 * this software without specific prior written permission
36 * * Neither the name of Ing.-Buero Dr. Michael Lehning nor the names of its
37 * contributors may be used to endorse or promote products derived from
38 * this software without specific prior written permission
39 *
40 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
41 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
42 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
43 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
44 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
45 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
46 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
47 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
48 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
50 * POSSIBILITY OF SUCH DAMAGE.
51  *
52  * Created on: 15th March 2024
53  *
54  * Authors:
55  * Michael Lehning <michael.lehning@lehning.de>
56  *
57  */
58 
59 #ifndef SICK_TF_PUBLISHER_H_
60 #define SICK_TF_PUBLISHER_H_
61 
63 
64 namespace sick_scan_xd
65 {
66  /*
67  ** @brief On ROS-1 and ROS-2, SickTransformPublisher publishes TF messsages to map a given base frame
68  ** (i.e. base coordinates system) to the lidar frame (i.e. lidar coordinates system) and vice versa.
69  **
70  ** The default base frame id is "map" (which is the default frame in rviz).
71  ** The default 6D pose is (x,y,z,roll,pitch,yaw) = (0,0,0,0,0,0) defined by
72  ** position (x,y,z) in meter and (roll,pitch,yaw) in radians.
73  ** This 6D pose (x,y,z,roll,pitch,yaw) is the transform T[base,lidar] with
74  ** parent "base" and child "lidar".
75  **
76  ** For lidars mounted on a carrier, the lidar pose T[base,lidar] can be configured in the launchfile:
77  ** <param name="tf_base_frame_id" type="string" value="map" /> <!-- Frame id of base coordinates system, e.g. "map" (default frame in rviz) -->
78  ** <param name="tf_base_lidar_xyz_rpy" type="string" value="0,0,0,0,0,0" /> <!-- T[base,lidar], 6D pose (x,y,z,roll,pitch,yaw) in meter resp. radians with parent "map" and child "cloud" -->
79  ** <param name="tf_publish_rate" type="double" value="10" /> <!-- Rate to publish TF messages in hz, use 0 to deactivate TF messages -->
80  **
81  ** The lidar frame id given by parameter "frame_id" resp. "publish_frame_id".
82  **
83  ** Note that SickTransformPublisher configures the transform using (x,y,z,roll,pitch,yaw).
84  ** In contrast, the ROS static_transform_publisher uses commandline arguments in order (x,y,z,yaw,pitch,roll).
85  **
86  */
88  {
89  public:
90 
92 
93  void run();
94 
95  void stop();
96 
97  protected:
98 #if __ROS_VERSION > 0
99  void runTFpublishThreadCb();
100  rosNodePtr nh = 0;
101  double tf_publish_rate = 10.0;
102  std::string tf_lidar_frame_id = "cloud";
103  std::string tf_base_frame_id = "map";
104  std::string tf_base_lidar_xyz_rpy = "0,0,0,0,0,0";
105  std::vector<float> tf_base_lidar_pose_vec;
106  bool tf_publish_thread_running = false;
107  std::thread* tf_publish_thread = 0;
108 #endif // __ROS_VERSION > 0
109  }; // class SickTransformPublisher
110 
111 } // namespace sick_scan_xd
112 #endif // SICK_TF_PUBLISHER_H_
sick_scan_xd
Definition: abstract_parser.cpp:65
sick_ros_wrapper.h
sick_scan_xd::SickTransformPublisher::SickTransformPublisher
SickTransformPublisher(rosNodePtr _nh=0)
Definition: sick_tf_publisher.cpp:87
sick_scan_xd::SickTransformPublisher
Definition: sick_tf_publisher.h:87
ros::NodeHandle
sick_scan_xd::SickTransformPublisher::stop
void stop()
Definition: sick_tf_publisher.cpp:139
sick_scan_xd::SickTransformPublisher::run
void run()
Definition: sick_tf_publisher.cpp:128
sick_scan_base.h


sick_scan_xd
Author(s): Michael Lehning , Jochen Sprickerhof , Martin Günther
autogenerated on Fri Oct 25 2024 02:47:11