A swerve drive is a special type of drivetrain used in FRC (FIRST Robotics Competition). It allows each individual wheel to be powered and turned independent from the other wheels, giving it unparalleled maneuverability on the field. It has following features:
- Independently steered drive modules
- Simple conceptually
- Simple wheels
- Good traction
- Complex to build
- Complex to program and control
- Maximum pushing force
- Either steered gearboxes or concentric drive
The off-the-shelf components for building and testing swerve-drive system are listed below. You can also download bracket (.stl) file for 3d printing from 'models' folder.
Parts | Model | Qty |
---|---|---|
Dynamixel Servo Motor | XL430-W250-T | 2 |
Communication Interface | U2D2 | 1 |
Wheel+Tire Set | TB3_WHEEL-ISW-01 | 1 |
SMPS | SMPS2Dynamixel | 1 |
Converting Cable(Molex-TTL) | ROBOT CABLE-X3P | 1 |
Communication Calbe(TTL) | ROBOT CABLE-X3P | 2 |
This work was tested under ROS Kinetic(desktop-full installation) + Ubuntu Xenial(16.04)
Motor's ID should be set as described picture below. You can set motor ID via dynamixel_workbench(Linux) or R+ Manager 2.0(Windows)
Following packages should be installed.
$ sudo apt-get install ros-kinetic-dynamixel-sdk
$ sudo apt-get install ros-kinetic-qt-build
$ sudo apt-get install ros-kinetic-dynamixel-workbench
$ sudo apt-get install ros-kinetic-dynamixel-workbench-msgs
- Clone this repository to your catkin workspace,
$ cd catkin_ws/src
$ git clone https://github.com/james-yoo/swerve_drive.git
- Compile the source,
$ cd ~/catkin_ws
$ catkin_make
$ source devel/setup.bash
- Launch the swerve_drive_control node,
$ roslaunch swerve_drive swerve_drive_control.launch
- Open the new terminal and start teleop_twist_keybord script,
$ rosrun teleop_twist_keyboard teleop_twist_keyboard.py
- Control with twist keybord command:
- 'i' = forward
- ',' = backward
- 'j' = left turn
- 'l' = right turn
- (Optional) To visualize swerve_drive in Rviz, open the new terminal,
$ roslaunch swerve_drive swerve_drive_urdf.launch