socrob / autonomous_systems

Material used for learning ROS and robotics, as part of the Autonomous Systems course at Instituto Superior Tecnico
34 stars 9 forks source link

PoseWithCovariance to rviz #18

Open Fbag96 opened 6 years ago

Fbag96 commented 6 years ago

Hi! We have a problem in showing the positions of aruco codes in rviz. If we use PoseArray (of ros) we can see the positions of the aruco codes in rviz:(like this)

captura de ecra de 2017-11-04 17-05-56

And we can check that this is right because in the gazebo environment it matches:

captura de ecra de 2017-11-04 17-07-08

Our problem is that we have to show the arucos pose estimation in rviz with the associated covariance and for that we have to use PoseWithCovariance (of ros) but this type of message do not receive a list but just a number We have 16 arucos and we don't want to create 16 topics, then publish in all them the pose with covariance and then manually execute them on rviz (showing the topic and selecting all 16). How can we find the better way to generate a list of Poses+Covariances of the arucos ?

oscar-lima commented 6 years ago

Looks to me that the best way would be to create your own (custom) msg of PoseWithCovariance array and make a republisher without the covariance for rviz visualization

Fbag96 commented 6 years ago

So you are saying that is not possible to see the covariance on rviz visualization using an array with Poses+Covariance? So it is impossible to represent all the covariances on rviz at once (using an array)? The only way is to generate all covariances and manually turning on this using the rviz panel and select PosewithCovariance?

oscar-lima commented 6 years ago

If you make the array, rviz will not visualize it. Unless there is a specific plugin handling that. i.e. the pose array stamped msg can be visualized in rviz. I suggest you to publish the msgs as they are so that you can visualize them (no array)

Fbag96 commented 6 years ago

So we have to create a topic for each aruco including there a pose + covariance or exists other way?

oscar-lima commented 6 years ago

You can create array and then another republisher node that subscribes to the array and publishes individual msgs on the same topic (iterate over the array) (ok rviz set the topic to remeber past n readings otherwise they will be visually overwritten)