forked from hbrobotics/ros_arduino_diff_drive
-
Notifications
You must be signed in to change notification settings - Fork 0
leo100du/ros_arduino_diff_drive
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
**NOTE** This package is depreciated and will not be further maintained. Please use the ros_arduino_bridge package instead as it incorporates the differential drive code as well as support for sensors and PWM servos. A simple driver for an Arduino controlled differential drive robot. Uses rosserial and assumes the use of an Arduino Mega + Pololu motor controller shield + Robogaia Mega Encoder shield. System Requirements =================== This package requires an Arudino Mega controller + Pololu Dual VNH5019 Motor Driver Shield + Robogaia Encoder shield. You must also install the Polulu Arduino library found at: https://github.com/pololu/Dual-VNH5019-Motor-Shield and the Robogaia Encoder library found at: http://www.robogaia.com/uploads/6/8/0/9/6809982/__megaencodercounter-1.3.tar.gz Finally, it is assumed you are using version 1.0 or greater of the Arduino IDE. Installation ============ $ cd ~/ros_workspace $ git clone https://github.com/hbrobotics/ros_arduino_diff_drive.git $ cd ros_arduino_diff_drive $ rosmake $ rosrun rosserial_client make_library.py SKETCHBOOK_PATH/libraries ros_arduino_diff_drive (Note: that should be a single command line above even if it wraps to two lines on the screen.) where SKETCHBOOK_PATH is the path to your Arduino sketchbook directory. $ cd SKETCHBOOK_PATH $ ln -s `rospack find ros_arduino_diff_drive`/src/libraries/ROSArduinoDiffDrive ROSArduinoDiffDrive (Note: that should be a single command line above even if it wraps to two lines on the screen.) Starting the Diff Controller ============================ * Make sure you have already installed the DualVNH5019MotorShield and MegaEncoderCounter libraries into your Arduino sketchbook/libraries folder * Launch the Arduino 1.0 IDE and load the ROSArduinoDiffDrive sketch * Compile and upload the sketch to your Arduino Mega * NOTE: Edit the pid_params.h file to match your robot's setup; e.g. wheel diameter, wheel track and encoder ticks per wheel revolution. Wheel track is the center-to-center distance between your drive wheels. Remember that all distances in ROS are in meters. Defaults are for 6" diameter drive wheels that are 11.5" apart and the encoder count is for the Pololu 131:1 motors. * In a terminal window run rosserial with the following launch command: $ roslaunch ros_arduino_diff_drive diff_drive.launch You should see the following output: process[serial_node-1]: started with pid [20785] process[odomlite_to_odom-2]: started with pid [20786] [INFO] [WallTime: 1355104107.728580] ROS Serial Python Node [INFO] [WallTime: 1355104107.729058] Connected on /dev/ttyACM0 at 57600 baud [INFO] [WallTime: 1355104109.901648] Note: publish buffer size is 512 bytes [INFO] [WallTime: 1355104109.901915] Setup publisher on odometry_lite [ros_arduino_diff_drive/OdometryLite] [INFO] [WallTime: 1355104109.904670] Note: subscribe buffer size is 512 bytes [INFO] [WallTime: 1355104109.904942] Setup subscriber on /cmd_vel [geometry_msgs/Twist] Sending Twist Commands and Viewing Odometry Data ================================================ Place your robot on blocks, then try publishing a Twist command: $ rostopic pub -1 /cmd_vel geometry_msgs/Twist '{ linear: {x: 0.1} }' Stop the robot with the command: $ rostopic pub -1 /cmd_vel geometry_msgs/Twist '{ linear: {x: 0.0} }' To view odometry data: $ rostopic echo /odom or $ rxplot -p 60 /odom/pose/pose/position/x:y, /odom/twist/twist/linear/x, /odom/twist/twist/angular/z
About
A simple driver for a differential drive base based on Arduino and ROS Serial
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published
Languages
- Other 69.7%
- C++ 21.6%
- CMake 8.4%
- Makefile 0.3%