This library by jcook3701 is being used for the integration of ros and the sFoundation library used for controlling ClearPath motors.
The 'move to' node sets up one ClearPath motor, and subscribes to a topic which has the current desired angle. Each loop it moves the motor to the desired angle.
Every time you plug in the SC-hub and want to communicate with it over linux, you need to install the XR drivers. I (Tyler) need to add this to the repo. It can be accessed from the link below if you look in ClearPath -> Software -> Linux_software.tar.gz and then follow the READMEs until you find the SC-Hub driver, and run the executable.
Build using catkin build
, and then run using
$ rosrun teknic_motor_controller one_motor_move_to
Test using:
$ rostopic pub -1 /cmd_angle std_msgs/Float64 -- <angle>
The angle is in pi radians, so if you put in 1 it goes 180 degrees. It uses the absolute angle, so if you put in -2 after you've put in 1 it goes to the position of 1 revolution backwards by spinning 1.5 revolutions backwards.
Below are the instructions for the Trash Bot Motor Controller by jcook3701. It may be broken from the port between ros-melodic to ros-noetic.
The following files are recommended for installation:
$ sudo apt-get install ros-noetic-teleop-twist-keyboard
- Create ROS Workspace.
$ mdir -p ~/Documents/ros_workspace/trash_bot_workspace/src
- Move to workspace.
$ cd ~/Documents/ros_workspace/trash_bot_workspace/src
- Clone this repository into newly created Trash Bot Workspace.
$ git clone [email protected]:jcook3701/teknic_motor_controller.git
- Move to the head of the project workspace and build the ROS Teknic Motor Controller.
$ cd .. && catkin_make
- Source the environment file from the head of the project workspace.
$ source devel/setup.bash
- Use roslaunch to start the motor controller.
$ roslaunch teknic_motor_controller trash_bot_motor_controller.launch
Note: The following assumptions are being made when using this motor controller.
- Each motor is driving two wheels. Each wheel has its own chain that connects it to either the left or the right motor.
- Motor orientation is the following:
(L) (R)
---[] []---
- There are exactly four wheels. This could be modified in the future with an additional parameter to the vehicle configuration file.
Vehicle Parameters:
- Number of Motors
- Description: Number of motors being used on vehicle. It is assumed that this number will be even with a minimum of two motors.
- Gear Ratio
- Description: Gear ratio between motor and single tire rotation.
- Wheel Base:
- Description: The length of the wheel base in meters.
- Wheel Radius:
- Description: The length of the wheel radius in meters.
- Tire Deflection
- Description: Deformation of tire at the point of contact
- Diameter Mod
- Description:
Teknic Motor Parameters:
- Encoder Resolution
- Description: Encoder tics per wheel revolution
- Max Motor Velocity
- Description: Max velocity that the motor may reach during operations.
- Max Motor Acceleration
- Description: Max acceleration that the motor may reach when ramping to the specified velocity.
- Max Motor Torque Percentage
- Description: Max percentage of available torque that the motor may use when operating.
Clearpath SC User Manual
Description: This goes over the general setup and configuration of ClearPath Motors.
S-Foundation Reference
Description: This goes over the ClearPath SDK.
Differential Drive Kinematics
Control of Mobile Robots- 2.2 Differential Drive Robots
Kinematics of a 4 wheeled differential drive robots
rosbot kernel headers