Skip to content

Instantly share code, notes, and snippets.

@mathewthomas916
Created July 27, 2020 19:55
Show Gist options
  • Save mathewthomas916/7ad05d652e6aea0d228fdb687747af45 to your computer and use it in GitHub Desktop.
Save mathewthomas916/7ad05d652e6aea0d228fdb687747af45 to your computer and use it in GitHub Desktop.
ROS2 URDF Gazebo Sensor
<gazebo reference="${name}_dist_sensor">
<sensor name="${name}_ultrasound" type="ray">
<always_on>true</always_on>
<visualize>false</visualize>
<pose>0.0 0 0.0 0 0 0</pose>
<update_rate>50</update_rate>
<ray>
<scan>
<horizontal>
<samples>5</samples>
<resolution>1.0</resolution>
<min_angle>-0.18</min_angle>
<max_angle>0.18</max_angle>
</horizontal>
<vertical>
<samples>5</samples>
<resolution>1.0</resolution>
<min_angle>-0.01</min_angle>
<max_angle>0.01</max_angle>
</vertical>
</scan>
<range>
<min>0.02</min>
<max>8</max>
<resolution>0.01</resolution>
</range>
<noise>
<type>gaussian</type>
<mean>0.0</mean>
<stddev>0.01</stddev>
</noise>
</ray>
<plugin name="bytes_ultrasound" filename="libgazebo_ros_ray_sensor.so">
<ros>
<namespace>distance</namespace>
<remapping>~/out:=${name}</remapping>
</ros>
<output_type>sensor_msgs/Range</output_type>
<radiation_type>ultrasound</radiation_type>
<frame_name>${name}_dist_sensor</frame_name>
</plugin>
</sensor>
<material>Gazebo/Blue</material>
</gazebo>
@Danendra10
Copy link

idk why it doesn't work on mine, I'm using ros 2 humble

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment