Closed JD-Florez closed 1 year ago
The trajectory of a single robot can be displayed. I set the fixed frame in RVIZ as the map of a certain robot, and then set the topic of the path to the optimized_trajectory of the same robot, so that I can see the trajectory of that robot. To switch the trajectory, the fixed frame should be switched. I am not sure if the author has provided a function to display the trajectories of all robots in one coordinate system.
You can also define a world frame as the "shared" coordinate system and add a static transform publisher for each robot
rosrun tf2_ros static_transform_publisher 0 0 0 0 0 1 world $ROBOT_NAME/map
To help future users with this issue, I wrote a roslaunch file doing what @yunzc mentioned: defining a world frame as the shared coordinate system and add a static transform publisher for each robot, so that the tf trees stay connected and we can visualize easily in RViz. Here is the launch file which has jackal1, jackal2, sparkal1, sparkal2, thoth, and hathor:
<launch>
<!-- sparkal 1 -->
<node pkg="tf2_ros" type="static_transform_publisher" name="static_transform_publisher_sparkal1" args="0 0 0 0 0 1 world sparkal1/map" />
<!-- sparkal 2 -->
<node pkg="tf2_ros" type="static_transform_publisher" name="static_transform_publisher_sparkal2" args="0 0 0 0 0 1 world sparkal2/map" />
<!-- jackal 1 -->
<node pkg="tf2_ros" type="static_transform_publisher" name="static_transform_publisher_jackal1" args="0 0 0 0 0 1 world acl_jackal/map" />
<!-- jackal 2 -->
<node pkg="tf2_ros" type="static_transform_publisher" name="static_transform_publisher_jackal2" args="0 0 0 0 0 1 world acl_jackal2/map" />
<!-- thoth -->
<node pkg="tf2_ros" type="static_transform_publisher" name="static_transform_publisher_thoth" args="0 0 0 0 0 1 world thoth/map" />
<!-- hathor -->
<node pkg="tf2_ros" type="static_transform_publisher" name="static_transform_publisher_hathor" args="0 0 0 0 0 1 world hathor/map" />
</launch>
After roslaunching this file, going to RViz and selecting the Paths as optimized_trajectory for each of the robots (e.g. /acl_jackal/kimera_vio_ros/optimized_trajectory
) will look like the screenshot below. Note that the single-robot VIO trajectory estimates from different robots will not be aligned in the same reference frame (in general), as noted by @yuluntian in #7.
Thanks a lot! It works, and I also reproduced the results:
Thank you so much for sharing this work. I have finished the setup and get no errors when building or running the provided example; however I did initially get "Fixed Frame [world] does not exist" in RVIZ with no visualization (I just see the grid and the background). When I change the fixed frame to any other available frame, I still can't see anything being visualized. Could you help me?