1
$\begingroup$

I'm using a plugin for visualization of topic type vision_msgs/Detection3DArray. I add a point cloud and there is not problem, but when I add this topic Rviz crashes with this error message:

original visual, set by message: position Vector3(0, 0, 0) with orientation Quaternion(0, 0, 0, 0)
rviz: /build/ogre-1.9-kiU5_5/ogre-1.9-1.9.0+dfsg1/OgreMain/include/OgreAxisAlignedBox.h:251: void Ogre::AxisAlignedBox::setExtents(const Ogre::Vector3&, const Ogre::Vector3&): La declaración `(min.x <= max.x && min.y <= max.y && min.z <= max.z) && "The minimum corner of the box must be less than or equal to maximum corner"' no se cumple.
Abortado (`core' generado)

rviz terminal output quaternion error

I get this plugin for visualization of this type of topics: https://github.com/Kukanani/vision_msgs_visualization

There are some failures like this in internet but no one is useful for me.

rviz ork object display

$\endgroup$
1
  • 1
    $\begingroup$ Please copy the error message as text and not as a picture, so that other will find this question in the future. $\endgroup$ Oct 30, 2023 at 21:32

1 Answer 1

2
$\begingroup$

You need to set orientation.w = 1 for every quaternion in the message if you don't have another orientation you want them to have. It's unfortunate that (0, 0, 0, 1) isn't the default value, or that rviz couldn't automatically force quaternions to be valid (and issue an error or warning) instead bringing down the whole application.

In to_ros_boxes_3d() in https://github.com/opendr-eu/opendr/blob/master/projects/opendr_ws/src/opendr_bridge/src/opendr_bridge/bridge.py#L769-L782 it sets the orientation of box.bbox but doesn't set it for box.results[0]- try adding box.results[0].pose.pose.orientation.w = 1.0 (and if there were more than one ObjectHypothesisWithPose be sure any others have orientation.w = 1.0 (unless you know the orientation ought to be something else).

$\endgroup$
9
  • $\begingroup$ Hi thanks for your comment. I'm new at ROS and I don't know how can i make this. Maybe doing rostopic pub and modifying the orientation value to 1 as you said? I don't know which could be the most efficient and fast way because I think that what I'm doing is only valid for once. I would appreciate any help thanks! $\endgroup$
    – ARosOpenDR
    Nov 2, 2023 at 18:28
  • $\begingroup$ Are you able to modify the publisher of the Detection3D messages? That is where the fix is needed. Or you have to have a new node subscribe to raw Detections, fix the w value in them, then republish and have rviz subscribe to those $\endgroup$ Nov 2, 2023 at 19:44
  • $\begingroup$ Yes, I can modify this file, but which should be the line I need to add to my code to fix this orientation? $\endgroup$
    – ARosOpenDR
    Nov 4, 2023 at 14:55
  • $\begingroup$ In the code that creates the Detection3D- do rosmsg show Detection3DArray and you'll see instances of orientation you need to fill out $\endgroup$ Nov 4, 2023 at 17:23
  • 1
    $\begingroup$ Ok I updated my answer after looking at that code $\endgroup$ Nov 15, 2023 at 18:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.