<aside> 💡 Goal: Create an easy way to use the xbox controller to move the robot

</aside>

Current Function & Problem

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

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.


Plan

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.

IMG_1139.jpeg

How to Run the Node

  1. In terminal A:
    1. mkdir xbox_test_ws
    2. mkdir xbox_test_ws/src
    3. git clone <https://github.com/uwrobotics/uwrt_mars_rover.git>
    4. cd uwrt_mars_rover
    5. git fetch
    6. git checkout user/wang-edward/220/drivetrain-xbox
    7. cd ../..
    8. colcon build --packages-select uwrt_mars_rover_xbox_controller
    9. ros2 launch teleop_twist_joy teleop-launch.py joy_config:='xbox'
  2. In terminal B:
    1. cd xbox_test_ws
    2. . install/setup.bash
    3. ros2 launch uwrt_mars_rover_xbox_controller xbox_launch.py
  3. In terminal C:
    1. cd xbox_test_ws
    2. . install/setup.bash
    3. ros2 launch uwrt_mars_rover_xbox_controller location_launch.py
  4. In terminal D:
    1. mkdir sim_ws
    2. mkdir sim_ws/src Then enter this directory
    3. git clone <https://github.com/uwrobotics/uwrt_mars_rover.git>
    4. cd uwrt_mars_rover
    5. git fetch
    6. git checkout comp-2024
    7. cd ../..
    8. colcon build
    9. ros2 launch uwrt_mars_rover_drivetrain_description gazebo2.launch.py