A repository for developing the User Interface for receiving data and controlling the rover
- Docker Containers for XBox controller Host and microcontroller with the Jetson
- Running the GPS and IMU data publisher and subscriber
- USB connection to Docker container
- Different branches in this repository
This guide will show you how to set up and launch the MRCS (Manual Rover Control System) using Docker on a bash terminal
- On a Linux OS or VM
- Docker Installation (Do not install the snap store version of docker)
- Latest version of Tmux: A link to a very useful guide: https://www.hamvocke.com/blog/a-quick-and-easy-guide-to-tmux/
- Open your bash terminal
- Clone the latest version of the MRCS repo using
git clone git@github.com:GonzagaRobotics/ManualRoverControlSystem.git
Steps 3 to 5 only if wanting to connect the joystick
- type
ls -l /dev/input/j - type
Tabtwice to find which number withjs#is the XBox controller- Then press
Enter
- Then press
- If the joystick is not
js0some otherjs#then change the following:- run
cd ManualRoverControlSystem/autolaunch/launch - in
auto_launch.pychange all instances ofjs0tojs# - go back and run
cd ManualRoverControlSystem/docker_scripts/for_host - in
docker-compose.ymlchange all instances ofjs0tojs#
- run
Steps 1 to 2 only if wanting to connect a microcontroller
- Plug in microconroller to computer with USB
- Run
sudo chmod 666 /dev/ttyUSB0- May have to change
ttyUSB#
- May have to change
- Go back and run
cd ManualRoverControlSystem/docker_scripts - Run the command
tmux(could also open a new terminal screen if you do not want to usetmux) - Open a tmux split screen terminal with
CTRL+Band pressing"- To close out of a panel at any time, type
exitor hitCTRL+D.
- To close out of a panel at any time, type
- On the terminal navigate to
for_hostby runningcd for_host - Run
docker compose upto start the Xbox controller - Press
CTRL+Band then theup arrowto navigate to the other termnial - In that terminal navigate to
for_jetsonby runningcd for_jetson - Run
docker compose up -d
For debugging
- Open a tmux split screen terminal from here with
CTRL+Band pressing"
Step 12 only if wanting to connect a microcontroller
- In this terminal run
docker start -ai for_jetson-micro-ros-agent-1- There should be messages from the microcontrollers here
- Press
CTRL+Band then theup arrowto navigate to the otherfor_jetsontermnial - In this terminal run
docker exec -it for_jetson-ros_echo-1 bash - In this docker container run
ros2 topic listto see ifmotor_commandis listed - Then run
ros2 topic echo /motor_command/left_triggerto see if this container can see the left trigger
- setup antennas for the host PC and Jetson from the
antenna_setup.mdfile in the repo - Go back and run
cd ManualRoverControlSystem/docker_scripts/for_host - Run
docker compose upto start the Xbox controller - On another terminal instance run
ssh robotics@192.168.0.2- enter the password to enter into the Jetson
- Plug in microconroller to Jetson with USB
- In the Jetson if not automatically done run
sudo chmod 666 /dev/ttyUSB0- May have to change
ttyUSB#
- May have to change
- In the Jetson run
cd ~/ManualRoverControlSystem/docker_scripts/for_jetson - Run
docker compose up -d
For debugging
- On the Jetson run the command
tmux - Open a tmux split screen terminal from here with
CTRL+Band pressing" - In this terminal run
docker start -ai for_jetson-micro-ros-agent-1- There should be messages from the microcontrollers here
- Press
CTRL+Band then theup arrowto navigate to the otherfor_jetsontermnial - In this terminal run
docker exec -it for_jetson-ros_echo-1 bash - In this docker container run
ros2 topic listto see ifmotor_commandis listed - Then run
ros2 topic echo /motor_command/left_triggerto see if this container can see the left trigger
- Press the
right triggeron the XBox controller and the motors should spin
This guide will show you how to set up and launch the MRCS (Manual Rover Control System) using ROS 2 on a Docker bash terminal.
- ROS2 Docker Terminal
- Latest version of Tmux: A link to a very useful guide can be found here.
-
Open your ROS 2 Docker terminal.
-
Create a new directory named
ros2_wswith a subdirectory calledsrcusingmkdir -p ros2_ws/src. -
Navigate to
srcby runningcd ros2_ws/src. -
Clone the latest version of the MRCS repo using
git clone git@github.com:GonzagaRobotics/ManualRoverControlSystem.git. -
Navigate out of
src. -
Build the project by running
colcon build.- If you encounter the error message
stderr: teleop_twist_joy, runcolcon buildagain to resolve it.
- If you encounter the error message
-
Source ROS2 in the parent directory by running the command:
. install/setup.bash. -
Startup
tmux.- A green status bar should appear. If it doesn't, make sure you have tmux installed in your docker container and try again.
-
Open a tmux split screen terminal
- A link to tmux keybinds can be found above.
- To close out of a panel at any time, type
exitor hitCTRL+D.
-
Navigate to a terminal and run the command to launch all nodes at once:
ros2 launch src/ManualRoverControlSystem/autolaunch/launch/auto_launch.py
-
By default, all nodes are launched with main launch command.
-
To stop specific nodes from launching, you can add any of the following commands after the main launch command:
- Add
xbox_broker:=Falseto stop the Command Broker node from launching. - Add
command_exposer:=Falseto stop the Command Exposer node from launching. - Add
command_receiver:=Falseto stop the Jetson_Comm node from launching. - Add
teleop_twist_node:=Falseto stop the Teleop_Twist node from launching. - Add
realsense2_camera:=Falseto stop the RealSense Camera node from launching.
- Add
-
For example, if you wanted to stop both the Command Exposer and Jetson_Comm nodes from launching, you'd use the command:
ros2 launch src/ManualRoverControlSystem/autolaunch/launch/auto_launch.py command_exposer:=False command_receiver:=False -
If you're inside the Jetson container the command to accomplish the same task would look like this:
ros2 launch autolaunch/launch/auto_launch.py command_exposer:=False command_receiver:=False- At any time with the following command, you can stop the launch file by pressing
CTRL+C. If you choose to launch all nodes at once, the output should look something like this(in this example the realsense camera wasn't connected):
[INFO] [launch]: Default logging verbosity is set to INFO [INFO] [realsense2_camera_node-2]: process started with pid [1063] [INFO] [joy_node-1]: process started with pid [1061] [INFO] [XboxBroker-3]: process started with pid [1065] [INFO] [CommandExposer-4]: process started with pid [1069] [INFO] [CommandReceiver-5]: process started with pid [1073] [realsense2_camera_node-2] [INFO] [1680378074.921175437] [camera.camera]: RealSense ROS v4.51.1 [realsense2_camera_node-2] [INFO] [1680378074.921306110] [camera.camera]: Built with LibRealSense v2.53.1 [realsense2_camera_node-2] [INFO] [1680378074.921340223] [camera.camera]: Running with LibRealSense v2.53.1 [realsense2_camera_node-2] [WARN] [1680378074.923078773] [camera.camera]: No RealSense devices were found! [CommandReceiver-5] [INFO] [1680378074.966731093] [CommandReceiver]: I have initialized up successfully. - At any time with the following command, you can stop the launch file by pressing
-
Navigate to another terminal panel.
-
In the bottom panel, run
ros2 topic list.- The list should look something like this:
/joy /joy/set_feedback /motor_command /motor_command_exposed /parameter_events /rosout -
Congratulations, you’re all set!
- Source from ros_ws:
. install/setup.bash - Command:
ros2 run command_broker XboxBroker - A node named XboxBroker that subscribes to 'joy' and publishes to 'motor_command' topic
- The topic 'motor_command' only includes the relevant data from the Xbox controller. The contents are likely to change.
- 'motor_command' contains multiple float messages that is mapped as follows:
- left trigger. Resting is 0.99999 and fully compressed is -0.99999
- right trigger: Resting is 0.99999 and fully compressed is -0.99999
- left shoulder: Resting is 0, compressed is 1
- right shoulder: Resting is 0, compressed is 1
- d pad left and right. resting is 0, left is 1 and right is -1
-
From inside the ros_ws directory, run
. install/setup.bash -
Command:
ros2 launch teleop_twist_joy teleop-launch.py joy_config:=’xbox’ joy_dev:=’dev/inputs/js1’- Note the the name of the USB might change so js1 might be different
-
Cloned from this repo: Link
-
Responsible for receiving the Xbox controller commands and publishing them to the 'joy' topic
These instructions assume the micro_ros_agent is already created on the host machine. To do this, follow the instructions on this link under Creating the micro-ROS agent https://micro.ros.org/docs/tutorials/core/first_application_linux/
Steps to connect microcontroller to ROS2:
- Plug microcontroller into Jetson over USB
- Determine the USB connection name:
ls -l /dev/tty* - (Optional) You might need to change the permissions on the USB to allow it to communicate:
sudo chmod 666 /dev/'connection name' - Go into microros_ws directory
source install/setup.bashros2 run micro_ros_agent micro_ros_agent serial --dev /dev/'connection name'- Press the enable button on the microcontroller
- You should now be able to see the microcontroller's nodes and topics using ros2 topic list and ros2 node list.
- Linux automatically does this
- Windows and Mac possible methods for USB connection
- USB over IP: https://github.com/jiegec/usbip
-
The rover and its various sub-systems will be controllable via a Manual Rover Control System (MRCS).
-
The MRCS will allow a human operator to drive the rover and manage its various sub-systems, including the operation of the manipulator arm.
-
The MRCS will have a User Interface (UI), that displays critical environmental information to the operator, including video stream and sensor data.
-
We will design, implement, test, and document an intuitive UI to display environmental data to a human operator and allow them to control the rover.
-
The MRCS will utilize ROS2 to send commands to and receive data from the rover over a wireless connection.
-
We will test the various components and overall whole of the MRCS using a Simulation of our rover.
- A Manual Control System (MRCS) that allows a human operator to drive the rover and operate its various components.
- The MRCS will display important data transmitted from the rover including video stream and other data.
- ROS2 Terminal
- Latest version of Tmux: A link to a very useful guide can be found here.
- plug in and run the microcontroller that runs the GPS and IMU
- Clone the latest version of the MRCS repo using
git clone git@github.com:GonzagaRobotics/ManualRoverControlSystem.git - Run
cd ManualRoverControlSystem - Run
colcon build --packages-select gps_imu_pubsub - Run
ros2 run gps_imu_pubsub gps_imu_sub
- UI development branches: ui_subscriber and dev-ui
- Camera display on Jetson: IntelCamera-Flury
- Camera display on Host: jetson_message_broker
- running the Realsense docker container in
docker_scripts/for_jetson, usedocker compose up -din that folder to build the container
- running the Realsense docker container in
- Preliminary MRCS R&D complete: Architecture designed and framework(s) chosen for building, development started
- MRCS v1.0.0 released: Major release of MRCS, rover sim can be fully controlled over ROS2 actions in a UI. Data from the rover (or rover sim) is displayed, including but not limited to video stream and sensor data. Physical rover will likely not be in a state for real world testing. Will need to test sending actions over the comms platform to the jetson once Electrical/Embedded has the comms platform ready to test.
- MRCS (minor release v1.x.x) capable of controlling physical rover, if complete. If not complete, MRCS capable of communicating over Comms system to send and receive all data and commands that would be necessary for control. MRCS capable of initiating ARCS control sequence.