forked from hbrobotics/ros_arduino_diff_drive
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
100 lines (62 loc) · 3.41 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
**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