Skip to content

Commit 2380e92

Browse files
committed
Import changes from ROS1 port
1 parent c709ab3 commit 2380e92

File tree

12 files changed

+187
-13
lines changed

12 files changed

+187
-13
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ Common ROS packages for Leo Rover that will work no matter on what machine they
44

55
* [leo] - Metapackage for this repository.
66
* [leo_description] - Robot description (URDF model).
7+
* [leo_msgs] - Message and Service definitions.
78
* [leo_teleop] - Scripts for robot's teleoperation.
89

910
Visit each package's ROS Wiki page for more information. \
1011
For more information about the robot, visit [Robots/Leo Rover].
1112

1213
[leo]: http://wiki.ros.org/leo
1314
[leo_description]: http://wiki.ros.org/leo_description
15+
[leo_msgs]: http://wiki.ros.org/leo_msgs
1416
[leo_teleop]: http://wiki.ros.org/leo_teleop
1517
[Robots/Leo Rover]: http://wiki.ros.org/Robots/Leo%20Rover

leo/package.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0"?>
22
<package format="3">
33
<name>leo</name>
4-
<version>1.2.1</version>
4+
<version>2.1.0</version>
55
<description>
66
Metapackage of software for Leo Rover common to the robot and ROS desktop
77
</description>
@@ -18,6 +18,7 @@
1818
<buildtool_depend>ament_cmake</buildtool_depend>
1919

2020
<exec_depend>leo_description</exec_depend>
21+
<exec_depend>leo_msgs</exec_depend>
2122
<exec_depend>leo_teleop</exec_depend>
2223

2324
<export>

leo_description/package.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0"?>
22
<package format="3">
33
<name>leo_description</name>
4-
<version>1.2.1</version>
4+
<version>2.1.0</version>
55
<description>
66
URDF Description package for Leo Rover
77
</description>

leo_description/urdf/macros.xacro

Lines changed: 52 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
rockers_fixed:=true
77
footprint_link:=true
88
link_prefix:=''
9-
joint_prefix:=''">
9+
joint_prefix:=''
10+
imu_translation:='0.0628 -0.0314 -0.0393'">
1011

1112
<xacro:macro name="rocker_link" params="name">
1213
<link name="${link_prefix}rocker_${name}_link">
@@ -125,6 +126,7 @@
125126

126127
<link name="${link_prefix}camera_frame"/>
127128
<link name="${link_prefix}camera_optical_frame"/>
129+
<link name="${link_prefix}imu_frame"/>
128130

129131
<!-- JOINTS -->
130132

@@ -218,6 +220,12 @@
218220
<child link="${link_prefix}camera_optical_frame"/>
219221
</joint>
220222

223+
<joint name="${joint_prefix}imu_joint" type="fixed">
224+
<origin xyz="${imu_translation}" rpy="0 0 0"/>
225+
<parent link="${link_prefix}base_link"/>
226+
<child link="${link_prefix}imu_frame"/>
227+
</joint>
228+
221229
</xacro:macro>
222230

223231
<!-- LEO GAZEBO -->
@@ -230,52 +238,72 @@
230238
<xacro:property name="link_prefix" value="${robot_ns}/"/>
231239
</xacro:if>
232240

241+
<!-- base ODE properties -->
242+
<gazebo reference="${link_prefix}base_footprint">
243+
<kp>1e6</kp>
244+
<kd>1.0</kd>
245+
<mu1>0.3</mu1>
246+
<mu2>0.3</mu2>
247+
<minDepth>0.003</minDepth>
248+
</gazebo>
249+
250+
<gazebo reference="${link_prefix}base_link">
251+
<kp>1e6</kp>
252+
<kd>1.0</kd>
253+
<mu1>0.3</mu1>
254+
<mu2>0.3</mu2>
255+
<minDepth>0.003</minDepth>
256+
</gazebo>
257+
233258
<!-- rocker ODE properties -->
234259
<gazebo reference="${link_prefix}rocker_L_link">
235260
<kp>1e6</kp>
236261
<kd>1.0</kd>
262+
<mu1>0.3</mu1>
263+
<mu2>0.3</mu2>
237264
<minDepth>0.003</minDepth>
238265
</gazebo>
239266

240267
<gazebo reference="${link_prefix}rocker_R_link">
241268
<kp>1e6</kp>
242269
<kd>1.0</kd>
270+
<mu1>0.3</mu1>
271+
<mu2>0.3</mu2>
243272
<minDepth>0.003</minDepth>
244273
</gazebo>
245-
246274
<!-- wheel ODE properties -->
247275
<gazebo reference="${link_prefix}wheel_FL_link">
248276
<kp>1e6</kp>
249-
<kd>1.0</kd>
277+
<kd>100.0</kd>
250278
<mu1>3.0</mu1>
251-
<mu2>0.5</mu2>
279+
<mu2>1.0</mu2>
252280
<fdir1>1 0 0</fdir1>
253281
<minDepth>0.003</minDepth>
254282
</gazebo>
255283

256284
<gazebo reference="${link_prefix}wheel_FR_link">
257285
<kp>1e6</kp>
258-
<kd>1.0</kd>
286+
<kd>100.0</kd>
259287
<mu1>3.0</mu1>
260-
<mu2>0.5</mu2>
288+
<mu2>1.0</mu2>
261289
<fdir1>1 0 0</fdir1>
262290
<minDepth>0.003</minDepth>
263291
</gazebo>
264292

265293
<gazebo reference="${link_prefix}wheel_RL_link">
266294
<kp>1e6</kp>
267-
<kd>1.0</kd>
295+
<kd>100.0</kd>
268296
<mu1>3.0</mu1>
269-
<mu2>0.5</mu2>
297+
<mu2>1.0</mu2>
270298
<fdir1>1 0 0</fdir1>
271299
<minDepth>0.003</minDepth>
272300
</gazebo>
273301

274302
<gazebo reference="${link_prefix}wheel_RR_link">
275303
<kp>1e6</kp>
276-
<kd>1.0</kd>
304+
<kd>100.0</kd>
277305
<mu1>3.0</mu1>
278-
<mu2>0.5</mu2>
306+
<mu2>1.0</mu2>
279307
<fdir1>1 0 0</fdir1>
280308
<minDepth>0.003</minDepth>
281309
</gazebo>
@@ -327,6 +355,20 @@
327355
</plugin>
328356
</gazebo>
329357

358+
<gazebo reference="${link_prefix}imu_frame">
359+
<sensor type="imu" name="leo_imu_sensor">
360+
<update_rate>100</update_rate>
361+
<plugin filename="libgazebo_ros_imu_sensor.so" name="imu_plugin">
362+
<robotNamespace>${robot_ns}</robotNamespace>
363+
<topicName>imu/data_raw</topicName>
364+
<frameName>${link_prefix}imu_frame</frameName>
365+
<updateRateHZ>100.0</updateRateHZ>
366+
<gaussianNoise>0.01</gaussianNoise>
367+
<initialOrientationAsReference>false</initialOrientationAsReference>
368+
</plugin>
369+
</sensor>
370+
</gazebo>
371+
330372
<ros2_control name="GazeboSystem" type="system">
331373
<hardware>
332374
<plugin>gazebo_ros2_control/GazeboSystem</plugin>

leo_msgs/CHANGELOG.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2+
Changelog for package leo_msgs
3+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4+
5+
2.1.0 (2022-01-31)
6+
------------------
7+
* Fix catkin_lint errors
8+
9+
2.0.1 (2021-12-28)
10+
------------------
11+
12+
2.0.0 (2021-12-02)
13+
------------------
14+
* Add comments to the Imu and WheelOdom message definitions
15+
* Add pwm_duty_cycle field to WheelStates
16+
* Add WheelOdom and WheelStates messages
17+
* Add temperature to Imu message
18+
* Initial leo_msgs package

leo_msgs/CMakeLists.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
cmake_minimum_required(VERSION 3.0.2)
2+
project(leo_msgs)
3+
4+
find_package(catkin REQUIRED COMPONENTS
5+
message_generation
6+
std_msgs
7+
)
8+
9+
add_message_files(FILES
10+
Imu.msg
11+
WheelOdom.msg
12+
WheelStates.msg
13+
)
14+
15+
generate_messages()
16+
17+
catkin_package(
18+
CATKIN_DEPENDS
19+
message_runtime
20+
std_msgs
21+
)

leo_msgs/msg/Imu.msg

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# This message holds the data retrieved from an Accel/Gyro+Temp IMU sensor
2+
#
3+
# The temperature field represents the temperature reported by the sensor in Degrees Celcius
4+
# The gyro_* fields represent the rotational velocity in rad/s
5+
# The accel_* fields represent the linear acceleration in m/s^2
6+
7+
time stamp
8+
float32 temperature
9+
float32 gyro_x
10+
float32 gyro_y
11+
float32 gyro_z
12+
float32 accel_x
13+
float32 accel_y
14+
float32 accel_z

leo_msgs/msg/WheelOdom.msg

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# This message represents the pose and velocity of a differential wheeled robot, estimated from the wheel encoders.
2+
#
3+
# The velocity_* fields represent the linear and angular velocity of the robot.
4+
# The pose_* fields represent the x, y and yaw pose of the robot w.r.t. the starting pose.
5+
#
6+
# The coordinate frame that represents the robot is located at the center of rotation.
7+
8+
time stamp
9+
float32 velocity_lin
10+
float32 velocity_ang
11+
float32 pose_x
12+
float32 pose_y
13+
float32 pose_yaw

leo_msgs/msg/WheelStates.msg

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# This message describes the states of the wheels in Leo Rover
2+
#
3+
# The state of each wheel is defined by:
4+
# * the position of the wheel (rad),
5+
# * the velocity of the wheel (rad/s)
6+
# * the torque that is applied in the wheel (Nm)
7+
# * the PWM Duty cycle (%)
8+
#
9+
# The stamp specifies the time at which the wheel states were recorded.
10+
#
11+
# This message consists of a multiple arrays, one for each part of the wheel state.
12+
# The order of the wheels in each array is: FL, RL, FR, RR
13+
14+
time stamp
15+
16+
float32[4] position
17+
float32[4] velocity
18+
float32[4] torque
19+
float32[4] pwm_duty_cycle

leo_msgs/package.xml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0"?>
2+
<package format="2">
3+
<name>leo_msgs</name>
4+
<version>2.1.0</version>
5+
<description>
6+
Message and Service definitions for Leo Rover
7+
</description>
8+
9+
<maintainer email="[email protected]">Fictionlab</maintainer>
10+
<author email="[email protected]">Błażej Sowa</author>
11+
12+
<license>MIT</license>
13+
14+
<url type="website">http://wiki.ros.org/leo</url>
15+
<url type="bugtracker">https://github.com/LeoRover/leo_common/issues</url>
16+
<url type="repository">https://github.com/LeoRover/leo_common</url>
17+
18+
<buildtool_depend>catkin</buildtool_depend>
19+
20+
<build_depend>message_generation</build_depend>
21+
<exec_depend>message_runtime</exec_depend>
22+
23+
<depend>std_msgs</depend>
24+
25+
<export>
26+
<architecture_independent/>
27+
</export>
28+
29+
</package>

0 commit comments

Comments
 (0)