Skip to content

Commit b069443

Browse files
authored
Merge pull request #2 from srmainwaring/develop
Release v0.2.0 - Simplify custom messages for servo data and commands - Simplify parameters for base controller for in arduino controller - Simplify the topic name for radio control data. - Add a regression stage to the encoder filter - Add Arduino firmware for servo controller and radio control decoder - Add odometry and a tf broadcaster - Add tuning parameters for odometry
2 parents ef09cc3 + e97ad91 commit b069443

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+4797
-1229
lines changed

README.md

Lines changed: 252 additions & 62 deletions
Large diffs are not rendered by default.

ackermann_drive_controller/package.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
<?xml version="1.0"?>
22
<package format="2">
33
<name>ackermann_drive_controller</name>
4-
<version>0.0.0</version>
4+
<version>0.2.0</version>
55
<description>Ackermann drive controller for a 6 wheel drive 4 wheel steering robot</description>
66
<maintainer email="rhys.manwaring@me.com">Rhys Mainwaring</maintainer>
77
<license>BSD-3-Clause</license>
8+
<url type="website">https://github.com/srmainwaring/curio</url>
9+
<url type="repository">https://github.com/srmainwaring/curio</url>
10+
<url type="bugtracker">https://github.com/srmainwaring/curio/issues</url>
811
<author email="rhys.manwaring@me.com">Rhys Mainwaring</author>
912
<buildtool_depend>catkin</buildtool_depend>
1013

curio_base/CMakeLists.txt

Lines changed: 61 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,18 @@ add_compile_options(-std=c++11)
88
# Find dependent catkin packages
99

1010
find_package(catkin REQUIRED COMPONENTS
11-
rospy
12-
# serial
11+
curio_description
12+
curio_control
13+
curio_msgs
1314
geometry_msgs
15+
joint_state_publisher
16+
nav_msgs
17+
robot_state_publisher
18+
roscpp
19+
rospy
20+
serial
1421
std_msgs
22+
tf
1523
)
1624

1725
################################################################################
@@ -23,31 +31,70 @@ catkin_python_setup()
2331
# Declare catkin configuration
2432

2533
catkin_package(
26-
# INCLUDE_DIRS include
27-
LIBRARIES
34+
INCLUDE_DIRS
35+
include
36+
LIBRARIES
37+
curio_base
2838
CATKIN_DEPENDS
29-
rospy
30-
# serial
39+
curio_description
40+
curio_control
41+
curio_msgs
3142
geometry_msgs
43+
joint_state_publisher
44+
nav_msgs
45+
robot_state_publisher
46+
roscpp
47+
rospy
48+
serial
3249
std_msgs
50+
tf
3351
)
3452

3553
################################################################################
3654
# Build
3755

38-
# include_directories(
39-
# include
40-
# ${catkin_INCLUDE_DIRS}
41-
# )
56+
include_directories(
57+
include
58+
${catkin_INCLUDE_DIRS}
59+
)
60+
61+
add_library(curio_base
62+
src/lx16a_driver.cpp
63+
)
64+
target_link_libraries(curio_base ${catkin_LIBRARIES})
65+
66+
add_executable(lx16a_position_publisher
67+
src/examples/lx16a_position_publisher.cpp
68+
)
69+
target_link_libraries(lx16a_position_publisher curio_base ${catkin_LIBRARIES})
4270

4371
################################################################################
4472
# Install
4573

74+
install(TARGETS
75+
curio_base
76+
lx16a_position_publisher
77+
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
78+
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
79+
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION})
80+
81+
install(DIRECTORY include/curio_base/
82+
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION})
83+
4684
catkin_install_python(PROGRAMS
47-
nodes/curio_motor_controller
85+
nodes/curio_base_controller
86+
scripts/lx16a_cmd_vel_random.py
87+
scripts/lx16a_cmd_vel_sinusoid.py
88+
scripts/lx16a_cmd_vel_stepped.py
4889
scripts/lx16a_driver_test.py
49-
scripts/lx16a_encoder_calibration.py
50-
scripts/lx16a_make_training_data.py
51-
scripts/lx16a_odometry.py
90+
scripts/lx16a_encoder_filter_test.py
91+
scripts/lx16a_encoder_logger.py
92+
scripts/lx16a_mean_filter_test.py
93+
scripts/lx16a_odometry_test.py
94+
scripts/lx16a_train_classifier.py
95+
scripts/lx16a_train_regressor.py
5296
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
5397
)
98+
99+
install(DIRECTORY config data launch
100+
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})

curio_base/README.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# LX-16A Learn
2+
3+
ML estimator to predict whether the position data from a LX-16A servo is in its valid range or not.
4+
5+
## Instructions
6+
7+
### Generate basic data
8+
9+
Run `roscore`:
10+
11+
```bash
12+
roscore
13+
```
14+
15+
Run rotary encoder node
16+
17+
```bash
18+
roslaunch curio_base rotary_encoder.launch
19+
```
20+
21+
Run the servo logger node:
22+
23+
```bash
24+
rosrun curio_base lx16a_encoder_logger.py
25+
```
26+
27+
Start `rqt` and use the topic publisher to the linear velocity component of `/cmd_vel`.
28+
29+
### Generate data from a simulation
30+
31+
#### Record a sample of `/cmd_vel`
32+
33+
Run `roscore`
34+
35+
```bash
36+
roscore
37+
```
38+
39+
Run the Gazebo simulation node:
40+
41+
```bash
42+
roslaunch curio_gazebo curio_mars_world.launch
43+
```
44+
45+
Run the `teleop_rc` node:
46+
47+
```bash
48+
roslaunch curio_teleop teleop_rc.launch port:=/dev/cu.usbmodemFD5121
49+
```
50+
51+
Relay `/cmd_vel` to `/ackermann_drive_controller/cmd_vel` for the controller:
52+
53+
```bash
54+
rosrun topic_tools relay /cmd_vel /ackermann_drive_controller/cmd_vel
55+
```
56+
57+
Start recording with `rosbag`:
58+
59+
```bash
60+
rosbag record -o curio_mars cmd_vel
61+
```
62+
63+
Drive the rover about the simulation using the RC unit.
64+
65+
#### Play a sample of `/cmd_vel`
66+
67+
Run `roscore`:
68+
69+
```bash
70+
roscore
71+
```
72+
73+
Run the rotary encoder node:
74+
75+
```bash
76+
roslaunch curio_base rotary_encoder.launch
77+
```
78+
79+
Run the servo logger node:
80+
81+
```bash
82+
rosrun curio_base lx16a_encoder_logger.py
83+
```
84+
85+
Play the `rosbag` using simulation time:
86+
87+
```bash
88+
rosparam set use_sim_time true
89+
rosplay --clock curio_mars_2020-01-11-16-49-30.bag
90+
```
91+
92+
The calibration node will record the encoder count associated with the servo position
93+
for the commanded duty.
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Curio base controller parameters
2+
#
3+
# ROS frame convention for mobile robots:
4+
#
5+
# x
6+
# ^
7+
# | longatudinal dir
8+
# |
9+
# lateral dir y <-------
10+
#
11+
#
12+
# Wheel geometry / servo location. The numbers are servo serial ids:
13+
# two digits for wheel servos, three digits for steering servos.
14+
#
15+
# <- front wheel lat separation ->
16+
# 11 / 111 |-----|-----| 21 / 212 ---
17+
# | ^
18+
# | front wheel lon separation
19+
# <- mid wheel lat separation -> v
20+
# 12 |-------|-------| 22 ---
21+
# | ^
22+
# | back wheel lon separation
23+
# | v
24+
# 13 / 131 |------|------| 23 / 233 ---
25+
# <- back wheel lat separation ->
26+
#
27+
28+
# Servo driver port settings
29+
# port: /dev/cu.wchusbserialfd5110
30+
port: /dev/ttyACM0
31+
baudrate: 115200
32+
timeout: 1.0
33+
34+
# Update frequencies: control loop
35+
control_frequency: 20.0
36+
37+
# Robot dimensions and limits
38+
max_linear_velocity: 0.37 # [m/s]
39+
max_angular_velocity: 1.45 # [rad/s]
40+
41+
wheel_radius: 0.060
42+
mid_wheel_lat_separation: 0.52
43+
front_wheel_lat_separation: 0.47
44+
front_wheel_lon_separation: 0.28
45+
back_wheel_lat_separation: 0.47
46+
back_wheel_lon_separation: 0.25
47+
48+
# Odometry calibration / tuning (default 1.0 - no adjustment)
49+
wheel_radius_multiplier: 1.0
50+
mid_wheel_lat_separation_multiplier: 0.96875
51+
52+
# Wheel servo parameters
53+
wheel_servo_ids: [ 11, 12, 13, 21, 22, 23]
54+
wheel_servo_lon_labels: ['front', 'mid', 'back', 'front', 'mid', 'back']
55+
wheel_servo_lat_labels: [ 'left', 'left', 'left', 'right', 'right', 'right']
56+
57+
# Steering servo parameters
58+
steer_servo_ids: [ 111, 131, 211, 231]
59+
steer_servo_lon_labels: ['front', 'back', 'front', 'back']
60+
steer_servo_lat_labels: [ 'left', 'left', 'right', 'right']
61+
steer_servo_angle_offsets: [ -10, -5, 40, 20]

curio_base/config/motor_controller.yaml

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

curio_base/data/lx16a_dataset.zip

11.2 MB
Binary file not shown.
3.78 MB
Binary file not shown.
106 KB
Binary file not shown.
1.34 MB
Binary file not shown.

0 commit comments

Comments
 (0)