Skip to content

Commit 1636f4d

Browse files
committed
rebsae onto main
1 parent b9cc31d commit 1636f4d

6 files changed

+58
-103
lines changed

Diff for: docs/packages/diffbot_base/index.md

+28-22
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,12 @@ The previous approach (high-level PID) is documented in [High-Level Approach](hi
5858
## Developing a low-level controller firmware and a high-level ROS Control hardware interface for a differential drive robot
5959

6060
In the following two sections, the base controller, mentioned in the Navigation
61-
Stack, will be developed. For DiffBot/Remo, this platform-specific node is split
62-
into two software components.
61+
Stack, will be developed.
62+
63+
![Navigation Stack]({{ asset_dir }}/navigation/navigation_stack.png)
64+
65+
For DiffBot/Remo, this platform-specific node is split into two software
66+
components.
6367

6468
The first component is the high-level `diffbot::DiffBotHWInterface` that
6569
inherits from `hardware_interface::RobotHW`, acting as an interface between
@@ -73,45 +77,47 @@ simulation and the real robot.
7377
An overview of ROS Control in simulation and the real world is given in the
7478
following figure (http://gazebosim.org/tutorials/?tut=ros_control):
7579

76-
<figure>
77-
<a href="{{ asset_dir }}/packages/diffbot_base/roscontrol-sim-reality.svg"><img src="{{ asset_dir }}/packages/diffbot_base/roscontrol-sim-reality.svg"></a>
78-
<figcaption>ROS Control in Simulation and Reality</figcaption>
80+
<figure markdown>
81+
![ROS Control simulation and reality]({{ asset_dir }}/packages/diffbot_base/ros-control-simulation-and-reality.svg)
82+
<figcaption>ROS Control in Simulation and Reality</figcaption>
7983
</figure>
8084

8185
The second component is the low-level base controller that measures angular
8286
wheel joint positions and velocities and applies the commands from the
8387
high-level interface to the wheel joints. The following figure shows the
8488
communication between the two components:
8589

86-
<figure>
87-
<a href="{{ asset_dir }}/packages/diffbot_base/block-diagram-low-high-level.svg"><img src="{{ asset_dir }}/packages/diffbot_base/block-diagram-low-high-level.svg"></a>
88-
<figcaption>Block diagram of the low-level controller and the high-level hardware interface</figcaption>
90+
<figure markdown>
91+
![Block diagram of low-level controller and high-level hardware interface]({{ asset_dir }}/packages/diffbot_base/block-diagram-low-level-base_controller-high-level-hardware_interface.svg)
92+
<figcaption>Block diagram of the low-level controller and the high-level hardware interface (ROS
93+
Control)</figcaption>
8994
</figure>
9095

9196
The low-level base controller uses two PID controllers to compute PWM signals
9297
for each motor based on the error between measured and target wheel velocities.
9398
`RobotHW` receives measured joint states (angular position (rad) and angular
9499
velocity (rad/s)) from which it updates its joint values. With these measured
95-
velocities and the desired command velocity (`geometry_msgs/Twist` message on the
96-
`cmd_vel` topic), from the Navigation Stack, the `diff_drive_controller` computes
97-
the target angular velocities for both wheel joints using the mathematical
98-
equations of a differential drive robot. This controller works with continuous
99-
wheel joints through a `VelocityJointInterface` class. The computed target
100-
commands are then published within the high-level hardware interface inside the
101-
robots `RobotHW::write` method. Additionally, the controller computes and
102-
publishes the odometry on the odom topic (`nav_msgs/Odometry`) and the transform
103-
from `odom` to `base_footprint`.
100+
velocities and the desired command velocity (`geometry_msgs/Twist` message on
101+
the `cmd_vel` topic), from the Navigation Stack, the `diff_drive_controller`
102+
computes the target angular velocities for both wheel joints using the
103+
mathematical equations of a differential drive robot. This controller works with
104+
continuous wheel joints through a `VelocityJointInterface` class. The computed
105+
target commands are then published within the high-level hardware interface
106+
inside the robot's `RobotHW::write` method. Additionally, the controller
107+
computes and publishes the odometry on the odom topic (`nav_msgs/Odometry`) and
108+
the transform from `odom` to `base_footprint`.
104109

105110

106-
Having explained the two components of the base
107-
controller, the low-level firmware is implemented first. The high-level hardware
108-
interface follows the next section.
111+
Having explained the two components of the base controller, the low-level
112+
firmware is implemented first. The high-level hardware interface follows the
113+
next section.
109114

110-
But before this an introduction to the PID controllers are given in [PID Controllers](pid.md).
115+
But before this an introduction to the PID controllers are given in [PID
116+
Controllers](pid.md).
111117

112118
### diffbot_base Package
113119

114-
The `diffbot_base` package is created with `catkin-tools`:
120+
The `diffbot_base` package was created with `catkin-tools`:
115121

116122
```console
117123
fjp@diffbot:/home/fjp/catkin_ws/src$ catkin create pkg diffbot_base --catkin-deps diff_drive_controller hardware_interface roscpp sensor_msgs rosparam_shortcuts

Diff for: docs/packages/index.md

+30-79
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,44 @@
11
# ROS Software Packages
22

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.
55

66
## Software requirements for the ROS Navigation Stack
77

88
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:
1111

1212
- `diffbot_base`: This package contains the platform-specific code for the base
1313
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.
2728
- `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.
3031
- `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
3334
the help of the launch files inside this package.
3435
- `remo_description`: This package contains the URDF description of Remo
3536
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.
3942
- `diffbot_gazebo`: Simulation-specific launch and configuration files for Remo
4043
and Diffbot, to be used in the Gazebo simulator.
4144
- `diffbot_msgs`: Message definitions specific to Remo/Diffbot, for example, the
@@ -45,58 +48,6 @@ launch files for the ROS Navigation Stack to work.
4548
- `diffbot_slam`: Configurations for simultaneous localization and mapping using
4649
implementations such as gmapping to create a map of the environment.
4750

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

Comments
 (0)