Skip to content

Commit bba7c1f

Browse files
Shuhei KozasaShota Aoki
andauthored
LiDARの追加 (#38)
* Update descriptions * Adds stl data of multi LIDAR mount * Adds xacro if for lds and rplidar. * Adds macro lidar_multi_mount * Adds macro lidar_multi_sensor * Update README. Adds License description * Adds stl file for LDS * Update specs * Update collision size * Adjust positions * Add colors * Adds legs for LDS * fix typo * Adds lidar parameter to macro lidar_multi_sensor. * Adds RPLIDAR thing * Adds lidar parameter to macro lidar_multi_sensor * Adds if statement. rplidar is to be added * Update README * Update file name * Update links * Update lidar macro * update macro names * Adds RPLIDAR macros * Update specs for RPLIDAR * Updates the position of LDS and the length of its legs * Updates RPLIDAR's position * Adds a command that displays the lidar mounted on the robot. * Replace material color to black * Adds leg visual macro for the lidars * Remove comments * Update urdf/raspimouse.urdf.xacro Co-authored-by: Shota Aoki <s.aoki@rt-net.jp> * Adjust the collision size and position of the LIDARs * Remove comment * Adjusts the size of the collision of the multi_lidar_mount * Adjust the inertial position * Adjust the inertial height of each LIDAR * LiDARマウントの重心位置を修正 Co-authored-by: Shota Aoki <s.aoki@rt-net.jp>
1 parent b9487f2 commit bba7c1f

File tree

7 files changed

+162
-9
lines changed

7 files changed

+162
-9
lines changed

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,20 @@ source install/setup.bash
3232

3333
## How to Use
3434

35-
Display a Raspberry Pi Mouse robot model on RViz2 with the following comand:
35+
Display a Raspberry Pi Mouse robot model on RViz2 with the following command:
3636

3737
```sh
3838
ros2 launch raspimouse_description display.launch.py
3939
```
4040

41+
You can also display a LiDAR mounted robot model with the following command:
42+
43+
```sh
44+
ros2 launch raspimouse_description display.launch.py lidar:=rplidar
45+
```
46+
47+
The `lidar` option supports `urg`, `lds`, and `rplidar`.
48+
4149
## LICENSE
4250

4351
(C) 2016-2021 RT Corporation
@@ -48,3 +56,6 @@ Unless attributed otherwise, everything in this repository is under the MIT lice
4856
### Acknowledgements
4957

5058
Special thanks to https://gbiggs.github.io/rosjp_urdf_tutorial_text/index.html
59+
60+
The file [robotis_lds01.stl](./meshes/stl/robotis_lds01.stl) is released from ROBOTIS and licensed under the [Apache License 2.0](https://github.com/ROBOTIS-GIT/turtlebot3/blob/a3c515b350a752b93ed8de4a009442e80e9d787d/LICENSE).
61+
The original file is released in [turtlebot3_description package](https://github.com/ROBOTIS-GIT/turtlebot3/blob/a3c515b350a752b93ed8de4a009442e80e9d787d/turtlebot3_description/meshes/sensors/lds.stl).

launch/display.launch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def generate_launch_description():
2828
declare_arg_lidar = DeclareLaunchArgument(
2929
'lidar',
3030
default_value='none',
31-
description='Set "none" or "urg".')
31+
description='Set "none", "urg", "lds", or "rplidar".')
3232
declare_arg_lidar_frame = DeclareLaunchArgument(
3333
'lidar_frame',
3434
default_value='laser',
409 KB
Binary file not shown.

meshes/stl/robotis_lds01.stl

656 KB
Binary file not shown.

urdf/body/option.urdf.xacro

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414
</geometry>
1515
</visual>
1616
<collision>
17-
<!-- <geometry> -->
18-
<!-- <mesh filename="package://raspimouse_description/meshes/dae/body/raspimouse_top_plate.dae"/> -->
19-
<!-- </geometry> -->
2017
<origin rpy="0 0 0" xyz="0.005 0 0.0435" />
2118
<geometry>
2219
<box size="0.117 0.080 0.087" />
@@ -30,4 +27,33 @@
3027
</link>
3128
</xacro:macro>
3229

30+
<xacro:macro name="lidar_multi_mount" params="prefix parent *joint_origin">
31+
<joint name="${prefix}_joint" type="fixed">
32+
<xacro:insert_block name="joint_origin" />
33+
<parent link="${parent}" />
34+
<child link="${prefix}_link" />
35+
</joint>
36+
<link name="${prefix}_link">
37+
<visual>
38+
<geometry>
39+
<mesh filename="package://raspimouse_description/meshes/stl/RasPiMouse_MultiLiDARMount.stl" scale="0.001 0.001 0.001"/>
40+
</geometry>
41+
<material name="Light Black">
42+
<color rgba="0.2 0.2 0.2 1.0" />
43+
</material>
44+
</visual>
45+
<collision>
46+
<origin rpy="0 0 0" xyz="0.0 0 0.002" />
47+
<geometry>
48+
<box size="0.135 0.095 0.005" />
49+
</geometry>
50+
</collision>
51+
<inertial>
52+
<origin xyz="0 0 0.002" />
53+
<mass value="0.04"/>
54+
<xacro:box_inertia m="0.04" x="0.13" y="0.1" z="0.002" />
55+
</inertial>
56+
</link>
57+
</xacro:macro>
58+
3359
</robot>

urdf/raspimouse.urdf.xacro

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
<xacro:arg name="robot_namespace" default="/" />
1414
<xacro:arg name="diffdrive_namespace" default="/" />
1515
<xacro:arg name="sensor_namespace" default="raspimouse_on_gazebo" />
16+
17+
<material name="black">
18+
<color rgba="0.2 0.2 0.2 1.0"/>
19+
</material>
1620

1721
<xacro:include filename="$(find raspimouse_description)/urdf/common.xacro" />
1822
<xacro:include filename="$(find raspimouse_description)/urdf/body/body.urdf.xacro" />
@@ -72,6 +76,23 @@
7276
</xacro:lidar_urg_sensor>
7377
</xacro:if>
7478

79+
<xacro:if value="${'$(arg lidar)' == 'lds'}">
80+
<xacro:lidar_multi_mount prefix="lds_multi_mount" parent="base_link">
81+
<origin xyz="0 0 0.0855" rpy="0 0 0" />
82+
</xacro:lidar_multi_mount>
83+
<xacro:lidar_lds_sensor sensor_link_name="$(arg lidar_frame)" parent="$(arg lidar)_multi_mount_link">
84+
<origin xyz="0.0 0.0 0.0345" rpy="0 0 3.14" />
85+
</xacro:lidar_lds_sensor>
86+
</xacro:if>
87+
88+
<xacro:if value="${'$(arg lidar)' == 'rplidar'}">
89+
<xacro:lidar_multi_mount prefix="rplidar_multi_mount" parent="base_link">
90+
<origin xyz="0 0 0.0855" rpy="0 0 0" />
91+
</xacro:lidar_multi_mount>
92+
<xacro:lidar_rp_sensor sensor_link_name="$(arg lidar_frame)" parent="$(arg lidar)_multi_mount_link">
93+
<origin xyz="0.0 0.0 0.0445" rpy="0 0 3.14"/> <!-- The LIDAR is about 13cm from the ground-->
94+
</xacro:lidar_rp_sensor>
95+
</xacro:if>
7596

7697
<!-- =============== Gazebo =============== -->
7798

@@ -104,6 +125,14 @@
104125
<xacro:lidar_gazebo sensor_link_name="$(arg lidar_frame)" base_rad="0" rad_range="4.71" min_range="0.10" max_range="5.6" />
105126
</xacro:if>
106127

128+
<xacro:if value="${'$(arg lidar)' == 'lds'}">
129+
<xacro:lidar_gazebo sensor_link_name="$(arg lidar_frame)" base_rad="0" rad_range="6.28" min_range="0.12" max_range="3.50" />
130+
</xacro:if>
131+
132+
<xacro:if value="${'$(arg lidar)' == 'rplidar'}">
133+
<xacro:lidar_gazebo sensor_link_name="$(arg lidar_frame)" base_rad="0" rad_range="6.28" min_range="0.15" max_range="12" />
134+
</xacro:if>
135+
107136
<!-- DiffDriveController -->
108137
<xacro:diffdrive_gazebo publish_tf="$(arg tf)" publish_jointstate="$(arg jointstate)"
109138
robot_namespace="$(arg diffdrive_namespace)" />

urdf/sensors/lidar.urdf.xacro

Lines changed: 91 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,37 @@
55

66
<xacro:arg name="laser_visual" default="false"/>
77

8+
<xacro:macro name="lidar_legs" params="length radius z_pos">
9+
<visual>
10+
<origin xyz="0.035 0.025 ${z_pos}" rpy="0 0 0" />
11+
<geometry>
12+
<cylinder length="${length}" radius="${radius}" />
13+
</geometry>
14+
<material name="black" />
15+
</visual>
16+
<visual>
17+
<origin xyz="0.035 -0.025 ${z_pos}" rpy="0 0 0" />
18+
<geometry>
19+
<cylinder length="${length}" radius="${radius}" />
20+
</geometry>
21+
<material name="black" />
22+
</visual>
23+
<visual>
24+
<origin xyz="-0.022 0.031 ${z_pos}" rpy="0 0 0" />
25+
<geometry>
26+
<cylinder length="${length}" radius="${radius}" />
27+
</geometry>
28+
<material name="black" />
29+
</visual>
30+
<visual>
31+
<origin xyz="-0.022 -0.031 ${z_pos}" rpy="0 0 0" />
32+
<geometry>
33+
<cylinder length="${length}" radius="${radius}" />
34+
</geometry>
35+
<material name="black" />
36+
</visual>
37+
</xacro:macro>
38+
839
<xacro:macro name="lidar_urg_sensor" params="sensor_link_name parent *joint_origin">
940
<joint name="${sensor_link_name}_joint" type="fixed">
1041
<xacro:insert_block name="joint_origin"/>
@@ -19,19 +50,75 @@
1950
</geometry>
2051
</visual>
2152
<collision>
22-
<!-- <geometry> -->
23-
<!-- <mesh filename="package://raspimouse_description/meshes/dae/sensor/urg_optical_axis_center_origin.dae"/> -->
24-
<!-- </geometry> -->
2553
<origin xyz="0 0 -0.01815" />
2654
<geometry>
2755
<cylinder radius="0.025" length="0.070"/>
2856
</geometry>
2957
</collision>
3058
<inertial>
31-
<mass value="0.160" />
59+
<mass value="0.16" />
3260
<origin xyz="0 0 0" />
3361
<xacro:cylinder_inertia m="0.16" r="0.025" h="0.07" />
3462
</inertial>
3563
</link>
3664
</xacro:macro>
65+
66+
<xacro:macro name="lidar_lds_sensor" params="sensor_link_name parent *joint_origin">
67+
<joint name="${sensor_link_name}_joint" type="fixed">
68+
<xacro:insert_block name="joint_origin"/>
69+
<parent link="${parent}"/>
70+
<child link="${sensor_link_name}"/>
71+
</joint>
72+
73+
<link name="${sensor_link_name}">
74+
<visual>
75+
<geometry>
76+
<mesh filename="package://raspimouse_description/meshes/stl/robotis_lds01.stl" scale="0.001 0.001 0.001"/>
77+
</geometry>
78+
<material name="black"/>
79+
</visual>
80+
<xacro:lidar_legs length="0.019" radius="0.005" z_pos="-0.0228"/>
81+
<collision>
82+
<geometry>
83+
<cylinder radius="0.035" length="0.040"/>
84+
</geometry>
85+
<origin xyz="0 0 -0.008" />
86+
</collision>
87+
<inertial>
88+
<mass value="0.160" />
89+
<origin xyz="0 0 0" />
90+
<xacro:cylinder_inertia m="0.16" r="0.025" h="0.03" />
91+
</inertial>
92+
</link>
93+
</xacro:macro>
94+
95+
<xacro:macro name="lidar_rp_sensor" params="sensor_link_name parent *joint_origin">
96+
<joint name="${sensor_link_name}_joint" type="fixed">
97+
<xacro:insert_block name="joint_origin"/>
98+
<parent link="${parent}"/>
99+
<child link="${sensor_link_name}"/>
100+
</joint>
101+
102+
<link name="${sensor_link_name}">
103+
<visual>
104+
<geometry>
105+
<mesh filename="package://raspimouse_description/meshes/stl/robotis_lds01.stl" scale="0.001 0.001 0.001"/>
106+
</geometry>
107+
<material name="black"/>
108+
</visual>
109+
<xacro:lidar_legs length="0.027" radius="0.003" z_pos="-0.028"/>
110+
<collision>
111+
<geometry>
112+
<cylinder radius="0.036" length="0.042"/>
113+
</geometry>
114+
<origin xyz="0 0 -0.008" />
115+
</collision>
116+
<inertial>
117+
<mass value="0.160" />
118+
<origin xyz="0 0 0" />
119+
<xacro:cylinder_inertia m="0.16" r="0.025" h="0.03" />
120+
</inertial>
121+
</link>
122+
</xacro:macro>
123+
37124
</robot>

0 commit comments

Comments
 (0)