Skip to content

Commit 7ca01e0

Browse files
ros2_control simplification and add arm_activate arg (#157)
* Unify configs * Reduce number of controller config files * imu_broadcaster/imu -> imu/data * Update vcs * Fix build * Default inactive arm controllers * Add activate_arm argument * Fix typo in readme * Fix arm_activate arg * Add arm_control script * Fix pre-commit * Fix rosbot_hardware_interfaces version * Fix description
1 parent 26afc67 commit 7ca01e0

File tree

26 files changed

+575
-777
lines changed

26 files changed

+575
-777
lines changed

MANIPULATOR.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,22 @@
66
> 1. **Before starting driver!** Make sure the manipulator is **undock**, manipulator is **away from a collision** (does not rest on robot objects) and **joints are away from its position limits** (e.g. one of the joints is started from extreme position).
77
> 2. Controlling MoveIt and via the joystick are two independent processes. You should not send commands to both of these services at the same time.
88
> 3. When the power supply is lost, the robot loses momentum and falls by inertia. Therefore, you should hold the manipulator when the power is cut off, or call the docking node `ros2 run open_manipulator_x_moveit dock` or press `RT` + `Back` buttons on gamepad.
9-
> 4. To improve the range of the manipulator's movements. The robot's URDF has hardcoded that the antenna is set at 90 degrees. It is a good idea to position the antenna in the same way on the physical robot.
9+
> 4. The manipulator does not analyze collisions with the antenna, to improve the range of the manipulator's movements. It's good practice to position the antenna horizontally on the physical robot.
1010
> 5. In the event of overload, loss of communication or sudden stopping of the manipulator process (e.g. during reboot), some joints may not receive the command to stop operation. This may prevent re-establishing communication. In such a case, it will be necessary to **reset the power supply**.
1111
1212
Below is a handful of the most important information for the ROSbot Manipulation/Manipulation PRO package.
1313

14+
## Activation
15+
16+
By default, the arm remains in an idle state after the driver is launched. To activate it, execute:
17+
18+
```bash
19+
sudo rosbot.arm-activate # if you are using snap
20+
ros2 run rosbot_controller arm_control active # if you are using local build
21+
```
22+
23+
You can change the driver's default behavior using the `arm_activate` argument.
24+
1425
## Control
1526

1627
After starting, the manipulator should be in the Home position after a few seconds. Now you can control ROSbot XL and OpenMANIPULATOR-X using a gamepad or RViz.
@@ -56,13 +67,15 @@ To do it, first you will have to disable the torque of the manipulator, for exam
5667
On your ROSbot XL execute. **Hold the manipulator** while doing it, as it disables the torque and the manipulator can fall.
5768

5869
```bash
59-
sudo rosbot.arm-disactivate
70+
sudo rosbot.arm-disactivate # if you are using snap
71+
ros2 run rosbot_controller arm_control inactive # if you are using local build
6072
```
6173

6274
Now you can manually move the manipulator to the desired position and launch:
6375

6476
```bash
65-
sudo rosbot.arm-activate
77+
sudo rosbot.arm-activate # if you are using snap
78+
ros2 run rosbot_controller arm_control active # if you are using local build
6679
```
6780

6881
### Modifications

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,14 @@ ros2 launch rosbot_gazebo simulation.launch.py robot_model:=<rosbot/rosbot_xl>
9999

100100
| 🤖 | 🖥️ | Argument | Description <br/> **_Type:_** `Default` |
101101
| --- | --- | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
102+
||| `arm_activate` | Whether to activate the manipulator arm on startup.. <br/> **_bool:_** `False` (`True` for simulation) |
102103
||| `config_dir` | Path to the common configuration directory. You can create such common configuration directory with `ros2 run rosbot_utils create_config_dir {directory}`. <br/> **_string:_** `""` |
103-
||| `configuration` | Specify configuration packages. Currently only ROSbot XL has available packages. Packages: `basic`, `telepresence`, `autonomy`, `manipulation`, `manipulation_pro`, `custom`. <br/> **_string:_** 'basic' |
104+
||| `configuration` | Specify configuration packages. Currently only ROSbot XL has available packages. Packages: `basic`, `telepresence`, `autonomy`, `manipulation`, `manipulation_pro`, `custom`. <br/> **_string:_** `basic` |
104105
||| `joy_vel` | The topic name to which velocity commands will be published. <br/> **_string:_** `cmd_vel` |
105106
||| `mecanum` | Whether to use mecanum drive controller, otherwise use diff drive. <br/> **_bool:_** `False` |
106107
||| `namespace` | Add namespace to all launched nodes. <br/> **_string:_** `env(ROBOT_NAMESPACE)` |
107108
||| `robot_model` | Specify robot model. <br/> **_string:_** `env(ROBOT_MODEL_NAME)` (choices: `rosbot`, `rosbot_xl`) |
108-
||| `manipulator_serial_port` | Port to connect to the manipulator. <br/> **_string:_** `8888` |
109+
||| `manipulator_serial_port` | Port to connect to the manipulator. <br/> **_string:_** `/dev/ttyUSB0` |
109110
||| `microros` | Automatically connect with hardware using microros. <br/> **_bool:_** `True` |
110111
||| `port` | **ROSbot XL only.** UDP4 port for micro-ROS agent. <br/> **_string:_** `8888` |
111112
||| `serial_baudrate` | ROSbot only. Baud rate for serial communication. <br/> **_string:_** `576000` |

ROS_API.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Detailed information about content of rosbot package for ROS2.
5656
||| **`cmd_vel`** | Sends velocity commands for controlling robot motion. <br /> _[geometry_msgs/Twist]_ |
5757
||| **`diagnostics`** | Contains diagnostic information about the robot's systems. <br /> _[diagnostic_msgs/DiagnosticArray]_ |
5858
||| **`dynamic_joint_states`** | Publishes information about the dynamic state of joints. <br /> _[control_msgs/DynamicJointState]_ |
59-
||| **`imu_broadcaster/imu`** | Broadcasts IMU (Inertial Measurement Unit) data. <br /> _[sensor_msgs/Imu]_ |
59+
||| **`imu/data`** | Broadcasts IMU (Inertial Measurement Unit) data. <br /> _[sensor_msgs/Imu]_ |
6060
||| **`joint_states`** | Publishes information about the state of robot joints. <br /> _[sensor_msgs/JointState]_ |
6161
||| **`odometry/filtered`** | Publishes filtered odometry data. <br /> _[nav_msgs/Odometry]_ |
6262
||| **`odometry/wheels`** | Provides odometry data from the base controller of the ROSbot XL. <br /> _[nav_msgs/Odometry]_ |

rosbot_bringup/test/test_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def create_test_subscribers_and_publishers(self):
5858
self.controller_odom_sub = self.create_subscription(
5959
Odometry, "odometry/wheels", self.controller_odometry_callback, 10
6060
)
61-
self.imu_sub = self.create_subscription(Imu, "imu_broadcaster/imu", self.imu_callback, 10)
61+
self.imu_sub = self.create_subscription(Imu, "imu/data", self.imu_callback, 10)
6262
self.ekf_odom_sub = self.create_subscription(
6363
Odometry, "odometry/filtered", self.ekf_odometry_callback, 10
6464
)
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
---
2+
/**:
3+
controller_manager:
4+
ros__parameters:
5+
update_rate: 100 # Hz
6+
7+
differential_drive_controller:
8+
type: diff_drive_controller/DiffDriveController
9+
mecanum_drive_controller:
10+
type: mecanum_drive_controller/MecanumDriveController
11+
imu_broadcaster:
12+
type: imu_sensor_broadcaster/IMUSensorBroadcaster
13+
joint_state_broadcaster:
14+
type: joint_state_broadcaster/JointStateBroadcaster
15+
16+
imu_broadcaster:
17+
ros__parameters:
18+
tf_frame_prefix_enable: false
19+
sensor_name: <namespace>/imu
20+
frame_id: imu_link
21+
static_covariance_orientation: [1.9e-3, 0.0, 0.0, 0.0, 1.9e-3, 0.0, 0.0, 0.0, 1.9e-3] # Values taken from datasheet
22+
static_covariance_angular_velocity: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0e-3] # Values measured experimentally
23+
static_covariance_linear_acceleration: [6.4e-2, 0.0, 0.0, 0.0, 2.2e-2, 0.0, 0.0, 0.0, 0.0] # Values measured experimentally
24+
25+
differential_drive_controller:
26+
ros__parameters:
27+
# Robot Specific
28+
tf_frame_prefix_enable: false
29+
left_wheel_names: [fl_wheel_joint, rl_wheel_joint]
30+
right_wheel_names: [fr_wheel_joint, rr_wheel_joint]
31+
wheel_separation: 0.186
32+
wheel_radius: 0.0425
33+
wheel_separation_multiplier: 1.36 # ICR coefficient isn't totally accurate and this coefficient can differ for various ground types
34+
left_wheel_radius_multiplier: 0.95 # Based on real measurements
35+
right_wheel_radius_multiplier: 0.95 # Based on real measurements
36+
odom_frame_id: odom
37+
base_frame_id: base_link
38+
pose_covariance_diagonal: [0.001, 0.001, 0.001, 0.001, 0.001, 0.01]
39+
twist_covariance_diagonal: [3.3e-5, 3.3e-5, 0.0, 0.0, 0.0, 2.8e-3] # Values measured experimentally
40+
41+
# Odometry
42+
publish_rate: 20.0
43+
open_loop: false
44+
position_feedback: false
45+
velocity_rolling_window_size: 1
46+
enable_odom_tf: false
47+
48+
# Publication
49+
cmd_vel_timeout: 0.5
50+
publish_limited_velocity: false
51+
use_stamped_vel: true
52+
53+
# Limits
54+
linear:
55+
x:
56+
max_velocity: 1.0 # m/s
57+
min_velocity: -1.0 # m/s
58+
max_acceleration: 1.0 # m/s^2
59+
max_deceleration: -1.0 # m/s^2
60+
max_acceleration_reverse: -1.0 # m/s^2
61+
max_deceleration_reverse: 1.0 # m/s^2
62+
max_jerk: .nan # m/s^3
63+
min_jerk: .nan # m/s^3
64+
65+
angular:
66+
z:
67+
max_velocity: 3.14 # rad/s
68+
min_velocity: -3.14 # rad/s
69+
max_acceleration: 4.0 # rad/s^2
70+
max_deceleration: -4.0 # rad/s^2
71+
max_acceleration_reverse: -4.0 # rad/s^2
72+
max_deceleration_reverse: 4.0 # rad/s^2
73+
max_jerk: .nan # rad/s^3
74+
min_jerk: .nan # rad/s^3
75+
76+
mecanum_drive_controller:
77+
ros__parameters:
78+
# Robot Specific
79+
tf_frame_prefix_enable: false
80+
front_left_wheel_name: fl_wheel_joint
81+
front_right_wheel_name: fr_wheel_joint
82+
rear_left_wheel_name: rl_wheel_joint
83+
rear_right_wheel_name: rr_wheel_joint
84+
wheel_separation_x: 0.106
85+
wheel_separation_y: 0.192
86+
wheel_radius: 0.047
87+
wheel_separation_x_multiplier: 1.0
88+
wheel_separation_y_multiplier: 1.0
89+
wheel_radius_multiplier: 1.0
90+
odom_frame_id: odom
91+
base_frame_id: base_link
92+
pose_covariance_diagonal: [0.001, 0.001, 0.001, 0.001, 0.001, 0.01]
93+
twist_covariance_diagonal: [3.3e-5, 3.3e-5, 0.0, 0.0, 0.0, 2.8e-3] # Values measured experimentally
94+
95+
# Odometry
96+
publish_rate: 25.0
97+
open_loop: false
98+
position_feedback: false
99+
velocity_rolling_window_size: 1
100+
enable_odom_tf: false
101+
102+
# Publication
103+
cmd_vel_timeout: 0.5
104+
publish_limited_velocity: false
105+
use_stamped_vel: true
106+
107+
# Limits
108+
linear:
109+
x:
110+
max_velocity: 1.0 # m/s
111+
min_velocity: -1.0 # m/s
112+
max_acceleration: 0.75 # m/s^2
113+
max_deceleration: -0.75 # m/s^2
114+
max_acceleration_reverse: -0.75 # m/s^2
115+
max_deceleration_reverse: 0.75 # m/s^2
116+
max_jerk: .nan # m/s^3
117+
min_jerk: .nan # m/s^3
118+
y:
119+
max_velocity: 1.0 # m/s
120+
min_velocity: -1.0 # m/s
121+
max_acceleration: 0.75 # m/s^2
122+
max_deceleration: -0.75 # m/s^2
123+
max_acceleration_reverse: -0.75 # m/s^2
124+
max_deceleration_reverse: 0.75 # m/s^2
125+
max_jerk: .nan # m/s^3
126+
min_jerk: .nan # m/s^3
127+
128+
angular:
129+
z:
130+
max_velocity: 3.14 # rad/s
131+
min_velocity: -3.14 # rad/s
132+
max_acceleration: 3.0 # rad/s^2
133+
max_deceleration: -3.0 # rad/s^2
134+
max_acceleration_reverse: -3.0 # rad/s^2
135+
max_deceleration_reverse: 3.0 # rad/s^2
136+
max_jerk: .nan # rad/s^3
137+
min_jerk: .nan # rad/s^3

rosbot_controller/config/rosbot/diff_drive_controller.yaml

Lines changed: 0 additions & 83 deletions
This file was deleted.

rosbot_controller/config/rosbot/mecanum_drive_controller.yaml

Lines changed: 0 additions & 92 deletions
This file was deleted.

0 commit comments

Comments
 (0)