-
The PicoBot is now configured to listen for control instuctions on its asynchronous webserver
- The instructions arrive as GET requests coming from
ps3_joypub.py
(running on my laptop) - This script uses the PiBorg Gamepad library to receive joystick position and button push events from a Sony PS3 Gamepad controller.
- The data are encoded in the
path
part of the GET request like so:http://192.168.1.64/x/y/b1/b2/b3/...
wherex
andy
are the joystick values andbn
encode various button push events.
- The pico bot interprets the x, y values as linear_spd, turning_spd and uses them to drive the picobot motors.
- The instructions arrive as GET requests coming from
-
Driving the PicoBot around, it seems to drive quite straight in both FWD & REV directions, and also does a pretty good job of turning in place. So there doesn't seem to be a need for the PID(C) feedback to regulate motor speed (provided by the motors class)
- The starting pose (x, y location and orientation angle) of the PicoBot defines its world coordinate system.
- Origin is at the centerline of the PicoBot, half way between the 2 wheels
- Positive X axis is straight ahead
- Y axis is along the common axis of the wheels, positive to the left
- Orientation starts at theta=0 along the X axis, Turning left causes value of orientation to increase.
- The PicoBot has its own local coordinate system initially aligned with the world coordinate system.
- Once the PicoBot moves, its local coordinate system moves with it, whereas the world coordinate system stays put. By counting the pulses from its encoders, the PicoBot keeps track of its position in the world coordinate system.
- One option for driving the PicoBot is to use the joystick control.
- The left joystick controls speed
- The right joystick controls turning
- Another option is to save a series of waypoints in a file called
waypoints.txt
- Then, by first pressing the TRIANGLE button, the saved waypoints will be read into a list of waypoints.
- Next, by pressing the SQUARE button, the PicoBot will drive to each waypoint in sequence, stopping on arrival at the final waypoint.
1, 0
1, 1
0, 1
0, 0
- Click on the image below to see a video of the PicoBot following the waypoints in the
waypoints.txt
file above. The waypoints are the corners of a square, 1 meter on each side.
IMG_3366.mp4
- In the demo above, the waypoints were entered manually into the
waypoints.txt
file. - It is also posible to enter the waypoints interactively while driving under joystick control.
- Start the PicoBot in its Home position.
- Press the PS button to erase the contents of the
waypoints.txt
file. - Use the joystick ccontrols to navigate to the first waypoint.
- Press the CIRCLE button to save the PicBot's currrent location as the first waypoint in the file.
- Repeat steps 3 & 4 to save all desired waypoints to the file.
- The
waypoints.txt
file is now finished.
- The
- Once the last waypoint has been saved, return the PicoBot to its Home position.
- Press the CROSS button to reset the odometer to (0, 0, 0).
- Press the TRIANGLE button to read the waypoint file into a list of waypoints.
- Press the SQUARE button, starting the PicoBot driving to each waypoint in sequence, stopping on arrival at the final waypoint.
- Optimize performace of current configuration
- Check to see if car is driving fully to 1 meter long legs. Maybe need to add a slow approach to full stop.
- Check to see if car's turns are really 90 degrees. Maybe need to adjust value for wheel spacing.
- Smoother joystick control. Issues with hesitancy, sluggishness and lag in joystick control.
- Doesn't feel as solid as the omni-car with bluetooth
- Try add-on HC-05 BT modules
- See if I can get built-in BT working
- Maybe use motors class again, with joystick to set target tick rate, PID to get PWM values.
- Doesn't feel as solid as the omni-car with bluetooth
- Extend current configuration
- Add back IMU & VL53LOX TOF-VCSEL's to enable reconciling accumulating pose errors when using wheel odometry alone.
- Use a map of the room, enabling:
- PicoBot to be able to discover its location w/r/t local features
- Laptop program to be able to display PicoBot's current pose on map