|
48 | 48 | #include <vrpn_Connection.h>
|
49 | 49 | #include <vrpn_Tracker.h>
|
50 | 50 | #include <Eigen/Geometry>
|
51 |
| -#include <eigen_conversions/eigen_msg.h> |
52 | 51 | #include <nav_msgs/Odometry.h>
|
53 | 52 | #include <geometry_msgs/TransformStamped.h>
|
54 |
| -#include <tf/transform_broadcaster.h> |
| 53 | +#include <tf2_ros/transform_broadcaster.h> |
| 54 | +#include <tf2_eigen/tf2_eigen.h> |
55 | 55 | #include <glog/logging.h>
|
56 | 56 |
|
57 | 57 | #include "vicon_odometry_estimator.h"
|
@@ -155,7 +155,7 @@ class Rigid_Body {
|
155 | 155 | ros::Publisher measured_target_transform_pub_;
|
156 | 156 | ros::Publisher estimated_target_transform_pub_;
|
157 | 157 | ros::Publisher estimated_target_odometry_pub_;
|
158 |
| - tf::TransformBroadcaster br; |
| 158 | + tf2_ros::TransformBroadcaster br; |
159 | 159 | // Vprn object pointers
|
160 | 160 | vrpn_Connection* connection;
|
161 | 161 | vrpn_Tracker_Remote* tracker;
|
@@ -319,33 +319,29 @@ void VRPN_CALLBACK track_target(void*, const vrpn_TRACKERCB tracker) {
|
319 | 319 | target_state->measured_transform.header.stamp = timestamp;
|
320 | 320 | target_state->measured_transform.header.frame_id = coordinate_system_string;
|
321 | 321 | target_state->measured_transform.child_frame_id = object_name;
|
322 |
| - tf::vectorEigenToMsg(position_measured_W, |
| 322 | + tf2::toMsg(position_measured_W, |
323 | 323 | target_state->measured_transform.transform.translation);
|
324 |
| - tf::quaternionEigenToMsg(orientation_measured_B_W, |
325 |
| - target_state->measured_transform.transform.rotation); |
| 324 | + target_state->measured_transform.transform.rotation = tf2::toMsg(orientation_measured_B_W); |
326 | 325 |
|
327 | 326 | // Populate the estimated transform message. Published in main loop.
|
328 | 327 | target_state->estimated_transform.header.stamp = timestamp;
|
329 | 328 | target_state->estimated_transform.header.frame_id = coordinate_system_string;
|
330 | 329 | target_state->estimated_transform.child_frame_id = object_name;
|
331 |
| - tf::vectorEigenToMsg(position_estimate_W, |
| 330 | + tf2::toMsg(position_estimate_W, |
332 | 331 | target_state->estimated_transform.transform.translation);
|
333 |
| - tf::quaternionEigenToMsg( |
334 |
| - orientation_estimate_B_W, |
335 |
| - target_state->estimated_transform.transform.rotation); |
| 332 | + target_state->estimated_transform.transform.rotation = tf2::toMsg( |
| 333 | + orientation_estimate_B_W); |
336 | 334 |
|
337 | 335 | // Populate the estimated odometry message. Published in main loop.
|
338 | 336 | target_state->estimated_odometry.header.stamp = timestamp;
|
339 | 337 | target_state->estimated_odometry.header.frame_id = coordinate_system_string;
|
340 | 338 | target_state->estimated_odometry.child_frame_id = object_name;
|
341 |
| - tf::pointEigenToMsg(position_estimate_W, |
342 |
| - target_state->estimated_odometry.pose.pose.position); |
343 |
| - tf::quaternionEigenToMsg( |
344 |
| - orientation_estimate_B_W, |
345 |
| - target_state->estimated_odometry.pose.pose.orientation); |
346 |
| - tf::vectorEigenToMsg(velocity_estimate_B, |
| 339 | + target_state->estimated_odometry.pose.pose.position = tf2::toMsg(position_estimate_W); |
| 340 | + target_state->estimated_odometry.pose.pose.orientation = tf2::toMsg( |
| 341 | + orientation_estimate_B_W); |
| 342 | + tf2::toMsg(velocity_estimate_B, |
347 | 343 | target_state->estimated_odometry.twist.twist.linear);
|
348 |
| - tf::vectorEigenToMsg(rate_estimate_B, |
| 344 | + tf2::toMsg(rate_estimate_B, |
349 | 345 | target_state->estimated_odometry.twist.twist.angular);
|
350 | 346 |
|
351 | 347 | // Indicating to the main loop the data is ready for publishing.
|
|
0 commit comments