Skip to content

Commit 3d32a2a

Browse files
author
Victor Lopez
committed
Add ROS2 control imu
1 parent 4167977 commit 3d32a2a

File tree

6 files changed

+27
-35
lines changed

6 files changed

+27
-35
lines changed

pmb2_description/gazebo/gazebo.urdf.xacro

-6
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,6 @@
5959
</accel>
6060
</noise>
6161
</imu>
62-
<plugin name="base_imu" filename="libgazebo_ros_imu_sensor.so">
63-
<ros>
64-
<!-- publish to /imu/data -->
65-
<remapping>~/out:=base_imu</remapping>
66-
</ros>
67-
</plugin>
6862
</sensor>
6963
</gazebo>
7064

pmb2_description/ros2_control/ros2_control.urdf.xacro

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
name="pmb2" >
1212

1313
<xacro:include filename="$(find pmb2_description)/urdf/wheels/wheel.ros2_control.xacro"/>
14+
<xacro:include filename="$(find pmb2_description)/urdf/sensors/sensors.ros2_control.xacro"/>
1415

1516
<ros2_control name="ros2_control_pmb2_system" type="system">
1617
<hardware>
@@ -20,6 +21,7 @@
2021
<!-- wheels -->
2122
<xacro:ros2_control_wheel side="right" />
2223
<xacro:ros2_control_wheel side="left" />
24+
<xacro:ros2_control_imu name="base_imu_sensor"/>
2325

2426
</ros2_control>
2527
</robot>

pmb2_description/urdf/base/base.urdf.xacro

-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@
9797
</xacro:antenna>
9898

9999
<!-- IMU -->
100-
<!-- @todo pmb2_hardware_gazebo needs an IMU! -->
101100
<xacro:imu_sensor name="${name}_imu" parent="${name}_link" update_rate="100.0">
102101
<origin xyz="0.10171 0 0.11282" rpy="0 0 ${-90 * deg_to_rad}"/>
103102
</xacro:imu_sensor>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
Copyright (c) 2011-2021, PAL Robotics, S.L.
4+
All rights reserved.
5+
6+
This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
7+
To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/3.0/ or send a letter to
8+
Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.
9+
-->
10+
<robot xmlns:xacro="http://ros.org/wiki/xacro">
11+
<xacro:macro name="ros2_control_imu" params="name">
12+
<sensor name="${name}">
13+
<state_interface name="orientation.x"/>
14+
<state_interface name="orientation.y"/>
15+
<state_interface name="orientation.z"/>
16+
<state_interface name="orientation.w"/>
17+
<state_interface name="angular_velocity.x"/>
18+
<state_interface name="angular_velocity.y"/>
19+
<state_interface name="angular_velocity.z"/>
20+
<state_interface name="linear_acceleration.x"/>
21+
<state_interface name="linear_acceleration.y"/>
22+
<state_interface name="linear_acceleration.z"/>
23+
</sensor>
24+
</xacro:macro>
25+
</robot>

pmb2_description/urdf/wheels/wheel.transmission.xacro

-27
This file was deleted.

pmb2_description/urdf/wheels/wheel.urdf.xacro

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041
1111

1212
<robot xmlns:xacro="http://ros.org/wiki/xacro">
1313

14-
<xacro:include filename="$(find pmb2_description)/urdf/wheels/wheel.transmission.xacro"/>
1514
<xacro:include filename="$(find pmb2_description)/urdf/wheels/wheel.gazebo.xacro"/>
1615

1716
<xacro:macro name="wheel" params="side reflect radius width torque velocity separation parent">

0 commit comments

Comments
 (0)