<aside> 💡 Goal: Create an easy way to use the xbox controller to move the robot
</aside>
Commands**:** Using command u, i, o, j, k, l, m, , , . move and pivot the robot as follows: Note: pivoting turns the wheels in the direction required
- ,: back
- U: counterclockwise pivot
- K: stop
- I: forward
- J: clockwise pivot
- .: clockwise pivot
- L: counterclockwise pivot
- O: counterclockwise pivot
- M: clockwise pivot
Problems:
There isn't any documentation about these commands and it seems that many of them do the same movements. Currently, these movements don't translate well to the xbox controller because they're not intuitive and some movements on the keyboard have the same function.
A way to improve on the current model is creating movements with the xbox controller in mind, and the best way to control directions using the 2 joysticks. The diagram below is a possible way to achieve this, and a plan we can begin to follow.
The left joystick defines speed control, while the labelled buttons move the wheels as needed. To stop the robot we would not press any button.
The combination of buttons will also have an effect. Example: Y and right on the joystick would accelerate the speed of the robot as it moves forward.
mkdir xbox_test_ws
mkdir xbox_test_ws/src
git clone <https://github.com/uwrobotics/uwrt_mars_rover.git
>cd uwrt_mars_rover
git fetch
git checkout user/wang-edward/220/drivetrain-xbox
cd ../..
colcon build --packages-select uwrt_mars_rover_xbox_controller
ros2 launch teleop_twist_joy teleop-launch.py joy_config:='xbox'
cd xbox_test_ws
. install/setup.bash
ros2 launch uwrt_mars_rover_xbox_controller xbox_launch.py
cd xbox_test_ws
. install/setup.bash
ros2 launch uwrt_mars_rover_xbox_controller location_launch.py
mkdir sim_ws
mkdir sim_ws/src
Then enter this directorygit clone <https://github.com/uwrobotics/uwrt_mars_rover.git
>cd uwrt_mars_rover
git fetch
git checkout comp-2024
cd ../..
colcon build
ros2 launch uwrt_mars_rover_drivetrain_description gazebo2.launch.py