Skip to content

Commit

Permalink
Add lidar to mars_rover model (#11).
Browse files Browse the repository at this point in the history
  • Loading branch information
mkhansenbot authored and ivanperez-keera committed Jan 30, 2024
1 parent 504df16 commit 6505526
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 6 deletions.
37 changes: 31 additions & 6 deletions models/curiosity_path/urdf/curiosity_mars_rover.gazebo
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,37 @@
</plugin>
</gazebo>

<gazebo reference="lidar_link">
<sensor name='lidar' type='gpu_lidar'>"
<ignition_frame_id>lidar_link</ignition_frame_id>
<pose relative_to='lidar_link'>0 0 0 0 0 0</pose>
<topic>scan</topic>
<update_rate>10</update_rate>
<ray>
<scan>
<horizontal>
<samples>640</samples>
<resolution>1</resolution>
<min_angle>-3.1416</min_angle>
<max_angle>3.1416</max_angle>
</horizontal>
<vertical>
<samples>1</samples>
<resolution>0.01</resolution>
<min_angle>0</min_angle>
<max_angle>0</max_angle>
</vertical>
</scan>
<range>
<min>1.0</min>
<max>20.0</max>
<resolution>0.05</resolution>
</range>
</ray>
<always_on>1</always_on>
<visualize>true</visualize>
</sensor>
</gazebo>

<gazebo reference="camera_link">
<sensor type="camera" name="camera_sensor">
Expand All @@ -157,12 +188,6 @@
</camera>
<always_on>1</always_on>
<topic>image_raw</topic>
<plugin
filename="ignition-gazebo-sensors-system"
name="ignition::gazebo::systems::Sensors">
<render_engine>ogre2</render_engine>
<background_color>0.9 0.753 0.66 1</background_color>
</plugin>
</sensor>
</gazebo>

Expand Down
26 changes: 26 additions & 0 deletions models/curiosity_path/urdf/sensor_mast.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,32 @@
<origin xyz="0.13642 -0.218683 0.222314" rpy="0 0 ${-PI/2}"/>
</joint>

<link name="lidar_link">
<!-- Inertial for gazebo to take it into account, Put 1gr weight -->
<inertial>
<origin xyz="0 0 0" rpy="0 0 0"/>
<mass value="0.001" />
<inertia ixx="9.1875e-09" ixy="0.0" ixz="0.0" iyy="9.1875e-09" iyz="0.0" izz="1.378125e-08"/>
</inertial>
<visual>
<origin rpy="0.0 0 0" xyz="0 0 0"/>
<geometry>
<cylinder radius="0.05" length="0.02"/>
</geometry>
<material name="black"/>
</visual>
</link>

<gazebo reference="lidar_link">
<material>Gazebo/Black</material>
</gazebo>

<joint name="lidar_joint" type="fixed">
<parent link="mast_cameras"/>
<child link="lidar_link"/>
<origin xyz="0 0 0.325" rpy="0 0 ${-PI/2}"/>
</joint>

</xacro:macro>

</robot>

0 comments on commit 6505526

Please sign in to comment.