1
1
# ROS Software Packages
2
2
3
- After having verified that the hardware requirements for the Navigation Stack are met, an
4
- overview of Remo's software follows.
3
+ After having verified that the hardware requirements for the Navigation Stack
4
+ are met, an overview of Remo's software follows.
5
5
6
6
## Software requirements for the ROS Navigation Stack
7
7
8
8
The [ ` diffbot ` ] ( https://github.com/ros-mobile-robots/diffbot/ ) and
9
- [ ` remo_description ` ] ( https://github.com/ros-mobile-robots/remo_description ) repositories
10
- contain the following ROS packages:
9
+ [ ` remo_description ` ] ( https://github.com/ros-mobile-robots/remo_description )
10
+ repositories contain the following ROS packages:
11
11
12
12
- ` diffbot_base ` : This package contains the platform-specific code for the base
13
13
controller component required by the ROS Navigation Stack. It consists of the
14
- firmware based on rosserial for the Teensy MCU and the C++ node running
15
- on the SBC that instantiates the ROS Control hardware interface including the
16
- ` controller_manager ` control loop for the real robot. The low-level ` base_controller `
17
- component reads the encoder ticks from the hardware, calculates
18
- angular joint positions and velocities, and publishes them to the ROS Control
19
- hardware interface. Using this interface makes it possible to use the ` diff_drive_controller `
20
- package from [ ROS Control] ( http://wiki.ros.org/diff_drive_controller ) .
21
- It provides a controller (` DiffDriveController ` ) for a
22
- differential drive mobile base that computes target joint velocities from commands
23
- received by either a teleop node or the ROS Navigation Stack. The computed
24
- target joint velocities are forwarded to the low-level base controller, where they are
25
- compared to the measured velocities to compute suitable motor PWM signals using
26
- two separate PID controllers, one for each motor.
14
+ firmware based on rosserial for the Teensy MCU and the C++ node running on the
15
+ SBC that instantiates the ROS Control hardware interface including the
16
+ ` controller_manager ` control loop for the real robot. The low-level
17
+ ` base_controller ` component reads the encoder ticks from the hardware,
18
+ calculates angular joint positions and velocities, and publishes them to the ROS
19
+ Control hardware interface. Using this interface makes it possible to use the
20
+ ` diff_drive_controller ` package from [ ROS
21
+ Control] ( http://wiki.ros.org/diff_drive_controller ) . It provides a controller
22
+ (` DiffDriveController ` ) for a differential drive mobile base that computes
23
+ target joint velocities from commands received by either a teleop node or the
24
+ ROS Navigation Stack. The computed target joint velocities are forwarded to the
25
+ low-level base controller, where they are compared to the measured velocities to
26
+ compute suitable motor PWM signals using two separate PID controllers, one for
27
+ each motor.
27
28
- ` diffbot_bringup ` : Launch files to bring up the hardware driver nodes (camera,
28
- lidar, microcontroller, and so on) as well as the C++ nodes from the ` diffbot_base `
29
- package for the real robot.
29
+ lidar, microcontroller, and so on) as well as the C++ nodes from the
30
+ ` diffbot_base ` package for the real robot.
30
31
- ` diffbot_control ` : Configurations for ` DiffDriveController ` and
31
- ` JointStateController ` of ROS Control used in the Gazebo simulation and the
32
- real robot. The parameter configurations are loaded onto the parameter server with
32
+ ` JointStateController ` of ROS Control used in the Gazebo simulation and the real
33
+ robot. The parameter configurations are loaded onto the parameter server with
33
34
the help of the launch files inside this package.
34
35
- ` remo_description ` : This package contains the URDF description of Remo
35
36
including its sensors. It allows you to pass arguments to visualize different
36
- camera and SBC types. It also defines the ` gazebo_ros_control ` plugin.
37
- Remo's description is based on the description at https://github.com/ros-mobile-robots/mobile_robot_description ,
38
- which provides a modular URDF structure that makes it easier to model your own differential drive robot.
37
+ camera and SBC types. It also defines the ` gazebo_ros_control ` plugin. Remo's
38
+ description is based on the description at
39
+ https://github.com/ros-mobile-robots/mobile_robot_description , which provides a
40
+ modular URDF structure that makes it easier to model your own differential drive
41
+ robot.
39
42
- ` diffbot_gazebo ` : Simulation-specific launch and configuration files for Remo
40
43
and Diffbot, to be used in the Gazebo simulator.
41
44
- ` diffbot_msgs ` : Message definitions specific to Remo/Diffbot, for example, the
@@ -45,58 +48,6 @@ launch files for the ROS Navigation Stack to work.
45
48
- ` diffbot_slam ` : Configurations for simultaneous localization and mapping using
46
49
implementations such as gmapping to create a map of the environment.
47
50
48
- After this overview of the ROS packages of a differential robot that fulfill the requirements
49
- of the Navigation Stack, the next section implements the base controller component.
50
-
51
-
52
- ## Developing a low-level controller and a highlevel ROS Control hardware interface for a differential drive robot
53
-
54
- In the following two sections, the base controller, mentioned in the Navigation Stack, will be developed.
55
-
56
- ![ Navigation Stack] ({{ asset_dir }}/navigation/navigation_stack.png)
57
-
58
- For Remo, this platform-specific node is split into two software components.
59
- The first component is the high-level ` diffbot::DiffBotHWInterface ` that
60
- inherits from ` hardware_interface::RobotHW ` , acting as an interface between
61
- robot hardware and the packages of ROS Control that communicate with the Navigation
62
- Stack and provide [ ` diff_drive_controller ` ] ( http://wiki.ros.org/diff_drive_controller ) –
63
- one of many available controllers from ROS Control. With the
64
- ` gazebo_ros_control ` plugin, the same controller including its configuration can be
65
- used in the simulation and the real robot. An overview of ROS Control in a simulation
66
- and the real world is given in the following figure (http://gazebosim.org/tutorials/?tut=ros_control ):
67
-
68
-
69
- <figure markdown >
70
- ![ ROS Control simulation and reality] ({{ asset_dir }}/packages/ros-control-simulation-and-reality.svg)
71
- <figcaption >ROS Control in simulation and reality</figcaption >
72
- </figure >
73
-
74
- The second component is the low-level base controller that measures angular wheel
75
- joint positions and velocities and applies the commands from the high-level interface
76
- to the wheel joints. The following figure shows the communication between the two
77
- components:
78
-
79
-
80
- <figure markdown >
81
- ![ Block diagram of low-level controller and high-level hardware interface] ({{ asset_dir }}/packages/low-level-base_controller-high-level-hardware_interface.svg)
82
- <figcaption >Block diagram of the low-level controller and the high-level hardware interface (ROS
83
- Control)</figcaption >
84
- </figure >
85
-
86
- The low-level base controller uses two PID controllers to compute PWM signals for each
87
- motor based on the error between measured and target wheel velocities.
88
- ` RobotHW ` receives measured joint states (angular position (rad) and angular velocity
89
- (rad/s)) from which it updates its joint values. With these measured velocities and the
90
- desired command velocity (` geometry_msgs/Twist ` message on the ` cmd_vel `
91
- topic), from the Navigation Stack, the ` diff_drive_controller ` computes the
92
- target angular velocities for both wheel joints using the mathematical equations of a
93
- differential drive robot. This controller works with continuous wheel joints through a
94
- ` VelocityJointInterface ` class. The computed target commands are then published
95
- within the high-level hardware interface inside the robot's ` RobotHW::write ` method.
96
- Additionally, the controller computes and publishes the odometry on the odom topic
97
- (` nav_msgs/Odometry ` ) and the transform from ` odom ` to ` base_footprint ` .
98
- Having explained the two components of the base controller, the low-level firmware is
99
- implemented first. The high-level hardware interface follows the next section.
100
-
101
- !!! note "TODO"
102
- TODO Details about implementation will follow (see code for now)
51
+ After this overview of the ROS packages of a differential robot that fulfill the
52
+ requirements of the Navigation Stack, the next pages explain those packages in
53
+ more detail.
0 commit comments