Balance charging the LiPo battery using the iMAX B6AC LiPo balance charger:
- Plug the charger to mains to power it up
- Check that the jacks of the charging cable are correctly connected to the charger (black to negative and red to positive).
- Connect the XT60 connector of the battery to the charging cable.
- Insert the JST-XH balance connector of the battery to the designated slot in the balance charger (In our case 3 cells).
- Use arrows to go to the Balance Charge setting.
- Select LiPo battery type.
- Confirm settings. For the 5000mAh 11.1V 50C LiPo battery: Lipo, 3.8A charging current (below 1C) and 11.1V (3S) configuration.
- Hold the Start button to start. Press it again to confirm.
- During charging: use arrows to move to the screen with 6 voltages. It is normal to see the lower three indications static at 0.00. This is because the charger is capable of charging batteries with up to 6 cells, but our battery actually has only three.
- The charger alarm will beep when charge is complete
Red switch on the side from O to I
SSH into the robot , source ROS2 workspace and spawn the robot:
(PC T1)$ ssh mhered@sevillabot
[email protected]'s password:
...
(bot T1)$ cd ~/robot_ws/
(bot T1)$ source install/setup.bash
(bot T1)$ ros2 launch sevillabot launch_robot.launch.py
Note: After the modification made to the launch file, this now spawns the robot, launches twist_mux
and launches the gamepad launcher joystick.launch.py
.
Shortcurt:
$ cd ~/sevillabot/commands
$ . activate_bot.bash
(Note: this step is no longer needed, it is already included in the robot launch file).
To control only robot the base: ssh into RPi, source and launch launch gamepad controller:
(PC T2)$ ssh mhered@sevillabot
[email protected]'s password:
...
(bot T2)$ cd ~/robot_ws/
(bot T2)$ source install/setup.bash
(bot T2)$ ros2 launch sevillabot joystick.launch.py
The controls are defined in a parameter file which implements:
- Dead man switches: LB button (left shoulder) for normal speed, RB button (right shoulder) for turbo
- Control on left stick: vertical axis for forward/backward motion and horizontal axis for rotation.
- Connect gamepad USB dongle to RPi top left USB port (to free reserved ports to Arduinos)
- Ensure gamepad mode is set to X (check switch in front face of gamepad)
Connect the gamepad to PC in Ubuntu:
- ensure it is charged (or charge with microUSB)
- to pair press HOME + SHARE (small button labelled 'S' on the left above the cross) until light flashes white (note if you press HOME + 'O' button on the right the white light blinks, not flashes)
- In Bluetooth settings select Wireless Controller to Connect. Light stops flashing and turns blue
- You may want to test it works with
$ evtest
This is an alternative (for base robot only) if no gamepad is available.
Launch keyboard teleop controller in PC:
(PC T2)$ ros2 run teleop_twist_keyboard teleop_twist_keyboard --ros-args -r /cmd_vel:=/cmd_vel_joy
Note remapping of topic /cmd_vel
to /cmd_vel_joy
(before was /diff_cont/cmd_vel_unstamped
but this changed after using twist_mux
)
Now you can move the robot from computer with the keyboard and see it in RVIZ!
Note: keyboard controls for addons are implemented only partially, see code/command_claw.py
and code/command_gun.py
To control also addons, ssh again into RPi, source and launch joy_subscriber
node:
(PC T3)$ ssh mhered@sevillabot
[email protected]'s password:
...
(bot T3)$ cd ~/robot_ws/
(bot T3)$ source install/setup.bash
(bot T3)$ ros2 launch sevillabot joy_subscriber.py
- For zombie challenge:
- Y button to toggle laser target
- X to fire
- Digital pad UP / DOWN to adjust aim up or down
- For Eco disaster
- Digital pad LEFT / RIGHT to open and close the claw
Source ROS2 workspace in PC and launch RVIZ:
(PC T4)$ cd ~/dev_ws/
(PC T4)$ source install/setup.bash
(PC T4)$ rviz2 -d ~/dev_ws/src/sevillabot/config/bot_with_sensors.rviz
Note we use a predefined config file but it is not necessary
SSH to the robot from another Terminal and launch the camera controller:
(PC T5)$ ssh mhered@sevillabot
[email protected]'s password:
...
(bot T4)$ cd ~/robot_ws/
(bot T4)$ source install/setup.bash
(bot T4)$ ros2 launch sevillabot camera.launch.py
Launch the LIDAR controller:
(bot T5)$ cd ~/robot_ws/
(bot T5)$ source install/setup.bash
(bot T5)$ ros2 launch sevillabot ld06.launch.py
RVIZ shows LiDAR. Try Orthographic View.
(PC T6)$ rviz2 -d ~/dev_ws/src/sevillabot/config/bot_with_sensors.rviz
In RVIZ Add Camera and select topic /image_raw/compressed
It does not show the camera feed in RVIZ as it should... BUT it works with RQT:
(PC T6)$ cd ~/dev_ws/
(PC T6)$ source install/setup.bash
(PC T6)$ ros2 run rqt_image_view rqt_image_view
$ sudo shutdown -h now
Wait a bit for RPi to power down before switching off mains red button.
NOT YET IMPLEMENTED
Safe reset and shutdown: the blue button.
- Shortly pressing the Blue button is ignored (considered noise)
- ~1 sec press resets the RPi (not sure if there is a use case for this)
- 4 sec press shuts down safely the RPi
After Lidar powers off (means RPi powered off) switch off mains red button
See implementation in file safe_shutdown.py
in:
- copy code over to sevillabot and update calls
ISSUES CREATED
-
** calibrate for sevillabot robot dimensions
-
** read addon controls from the
joystick.yaml
param file
- ** optimize controls. e.g. move left-right to right joystick?
- ** integrate
joy_subscriber
in the joystick launch file to control gun and clamp addons ?? - add photos / video of battery charging
- fix issue with camera in RVIZ
- implement power down button making it more usable (remove short press for reset and provide feedback for shutdown)
- wheels skid, big time
- motors have a lot of hysteresis