Custom ROS node with functionality of the TrackingViewer

hi,

I intend to write a ROS node that largely uses the functionality of the TrackingViewer from the SDK. After that, I want to publish the results and visualize them in Rviz. I would use zed_interfaces::Object to access the objects and as far as I have seen, I can access/process relevant data used like in the TrackingViewer.cpp/hpp in ROS as well with just minor modifications.

However, I would still like to ask here briefly whether I have overlooked anything important or whether it is possible to implement my plan without running into major problems?

Thanks in advance!

Hi @hetachXORw
Welcome to the Stereolabs community.

If you use the custom object message types defined in zed_interfaces you will not have problems using the Rviz Object Detector plugin.
Your approach seems correct.

Hi @Myzhar thank’s a lot for your quick reply!

You mean the Rviz plugin which is provided here and to use it as a base?

Thx

Yes, it is a good example of how to process the data from the object messages.

@Myzhar thanks a lot for your hints.

I’m in the process of implementing my code for the TrackingViewer in the Rviz Object Detector plugin first.

One problem I still have is that I’m wondering how I can access some important data in the sl namespace or from sl/Camera.hpp that is also used in the Tracking Viewer (e.g. the important ones are sl:: Pose, sl::Translation, sl::Rotation). Also accessing the CameraInformation data from Camera.hpp would be nice. Or is it better in my case to retrieve this camera data via a ROS topic and maybe a timestamp?

Thanks in advance, I really like it to work with ZED :slight_smile:

Hi @hetachXORw
you cannot access data for an sl::Camera object if you are not connected to a camera.
You are in the ROS environment, to the data you need are all available in messages published by the ZED node on the relative topics.
You can get the list of all the topics published by the ZED node with the command
rostopic list | grep zed

Hi @Myzhar

Thank you, but I am still wondering how to access the mask data of an object inside the bounding box? I’ve seen that it is possible in the SDK (via object.mask) to get just the pixels inside a bounding box that belong to an object but I am wondering how I can access this data in the ROS environment? Is it also accessable via a ROS topic?

Thank you

This is not possible for ROS.
If you need this feature you can modify the code of the wrapper to enable it.

Hi @Myzhar I’m wondering which pose data in ROS msgs is the equivalent data to the pose data in the TrackingViewer in the SDK. I have compared the data and am assuming that the data from nav_msgs::Odometry is correct?

No, it’s geometry_msgs::PoseStamped