Visualization rviz2

asked 2021-01-14 05:03:54 -0500

Schloern93 gravatar image

Hello

I am using the Intel Realsense D435 camera and the depth_image_proc package to create me a sorted point cloud message. Now I want to display a box in rviz for all detected objects which matches the published PointCloud2 points in rviz.

I can display the boxes also so far in rviz. The problem is that when I move the camera in rviz the boxes move with it. (looks a bit weird) How can I set the boxes so that they get a fixed point in space? The points of the point cloud message have a fixed point when I move the camera. What do I have to do with my created boxes so that they behave like the points in the PointCloud message and are fixed in space.

I use:

visualization_msgs::msg::Marker bounding_box;

to display the boxes in rviz.

These are the settings I made for the markers. I have set the frameID to the same frame at which the PointCloud message can be displayed in rviz.

//steup frame
  bounding_box.header.frame_id = "/camera_link";
  bounding_box.ns = "line";
  bounding_box.action = visualization_msgs::msg::Marker::ADD;
  bounding_box.pose.orientation.w = 1.0;
  bounding_box.id = 0;
  //set Line Type
  bounding_box.type = visualization_msgs::msg::Marker::LINE_LIST;      
  bounding_box.scale.x = 0.05;
  //color

  bounding_box.color.a = 1.0;
  bounding_box.color.b = 1.0;

Thanks for the help

edit retag flag offensive close merge delete