ctu-mrs / mrs_rviz_plugins

Custom RVIZ plugins. Part of the "mrs_uav_core".
https://github.com/ctu-mrs/mrs_uav_core
BSD 3-Clause "New" or "Revised" License
6 stars 2 forks source link

Reg : Visualizing multiple airframe in same rviz #13

Open johnd2010 opened 1 week ago

johnd2010 commented 1 week ago

Hi

I was using "roslaunch mrs_rviz_plugins load_robot.launch" for visualizing a robot frame in rviz. Can you please let me know if it is possible to visualize multiple drones in the same rviz instance?

I have access to the tf of all drones involved and ran an instance of "roslaunch mrs_rviz_plugins load_robot.launch" for each UAV. I linked the world_origin frame of each UAV but still was not able to visualize all the drones in one frame.

Thanks in advance

klaxalk commented 1 week ago

Hey, yes this is possible. Run

export UAV_NAME=uav1 && export UAV_TYPE=x500 && roslaunch mrs_rviz_plugins load_robot.launch

for each UAV (and set the UAV_NAME and UAV_TYPE right).

Then just add the model entry in rviz and set the robot description to /uav1/robot_model for each UAV respectively.

image

johnd2010 commented 1 week ago

Thank you for the prompt response, Tomas.

I repeated the process to load 3 UAV models export UAV_NAME=uav1 && export UAV_TYPE=x500 && roslaunch mrs_rviz_plugins load_robot.launch export UAV_NAME=uav2 && export UAV_TYPE=x500 && roslaunch mrs_rviz_plugins load_robot.launch export UAV_NAME=uav3 && export UAV_TYPE=x500 && roslaunch mrs_rviz_plugins load_robot.launch

Now to have them all in the same rviz frame, I linked their world_frames with a launch file

rosrun tf2_ros static_transform_publisher 0 0 0 0 0 0 uav1/world_origin uav2/world_origin rosrun tf2_ros static_transform_publisher 0 0 0 0 0 0 uav2/world_origin uav3/world_origin rosrun tf2_ros static_transform_publisher 0 0 0 0 0 0 uav1/world_origin uav3/world_origin

I was not able to see all three models in a single rviz window (frame used: uav1/world_origin), as it was requesting tf connections between fcus. Please find the image appended.

image