Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to access depthai_filters detection data? #558

Open
mythrai opened this issue Jul 8, 2024 · 1 comment
Open

How to access depthai_filters detection data? #558

mythrai opened this issue Jul 8, 2024 · 1 comment
Labels
question Further information is requested

Comments

@mythrai
Copy link

mythrai commented Jul 8, 2024

For our project, we're trying to use the depthai_filters package to detect objects and we want to send the detection data to the robot arm it'll be attached to. We wrote a ros node that is subscribed to the /spatial_bb topic. The node is of the type <visualization_msgs::msg::MarkerArray> and within the spatial_bb.cpp file, there's a publisher declared (markerPub) that is publishing data of the <visualization_msgs::msg::MarkerArray> type as well.
The issue comes about when we've been trying to display the data that our subscriber node is receiving. When we try to print msg.markers directly, it prints an address when the camera detects an object (which makes sense since markers is an array). When we try to print an element of the markers array (like msg.markers[0]), we get a segmentation fault once the camera isn't actively detecting something (since the array is empty) and an address/nonsense when it does detect something. We specifically want to access the 'text' field of the markers array as it tells you what's been detected, but we're only able to access the 'text' field within the visualization_msgs::msg::Marker namespace. When we write the node in that namespace however, we are unable to receive data from the spatial_bb.cpp markerPub publisher since its data is of the MarkerArray type.
How should we go about writing a subscriber that successfully receives the markerPub data from spatial_bb.cpp and is able to print it?

@mythrai mythrai added the question Further information is requested label Jul 8, 2024
@Serafadam
Copy link
Collaborator

Hi, would it be possible for you to share your code? I think the most straightforward solution would be to create your own node based on spatial_bb, since then you will have access to the same data that the markers are created with

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants