How to set visualize-tag in ray

asked 2019-05-02 06:10:11 -0500

living_in_simulation gravatar image

Hi, I am currently writing my own ROS-laser-plugin because I want to have a multi-ray-laser that doesn't have multiple lines of horizontal rays but the rays should be arbitrary (for example an 8-figure).

I created a RayShapePtr using the following code-snippet:

// Create ray
gazebo::physics::RayShapePtr ray1 = boost::dynamic_pointer_cast<gazebo::physics::RayShape>(this->collision_ptr_->GetShape());
// Set start- and end-point to ray
ray1->SetPoints(start, end1);
// Add created ray to list
// later on I get the intersection with the ray using the following code-snippet:
this->rays_[i]->GetIntersection(dist, entityName);

However, for debugging purposes I would like to visualize this ray in Gazebo just like the normal ray-plugin in Gazebo when I use the following tag in the urdf/sdf:


It seems that when I created the ray1 in the code above it doesn't get visualized like the rays I specified in the urdf/sdf using the following configuration:

<gazebo reference="my_laser_frame">
      <sensor type="ray" name="my_laser_link_sensor">
        <pose>0 0 0 0 0 0</pose>
        <plugin name="gazebo_ros_my_laser_controller" filename="">

In short: The rays defined in the urdf are visualized in Gazebo but not my own programatically created RayShape (e.g. ray1) in the plugin-code. Does anyone have any idea how I can also visualize the programatically created RayShape in Gazebo?

Thanks in advance.

edit retag flag offensive close merge delete