Sign inSign up

djnighti/ucsd_robocar

By djnighti

•Updated over 3 years ago

Image
0

3.0K

djnighti/ucsd_robocar repository overview

⁠ucsd_robocar

Official docs explaining what this docker image is used for can be found in either the ROS-NOETIC related packages or the ROS2-FOXY related packages below:

The exact "recipe" to build this image can be found here⁠

⁠Useful Docker commands

Lingo: NAMES---container name, REPOSITORY---Image name, TAG---Image tag ID (comparable to branches in git)

  • pulling image from docker hub: docker pull REPOSITORY:TAG
  • starting a stopped container: docker start NAMES
  • stopping a container: docker stop NAMES
  • save changes made while in container to original image (change tag to create a new image): docker commit name_of_container REPOSITORY:TAG
  • create a new image from a container: docker tag NAMES REPOSITORY:TAG
  • list all images: docker images
  • list all running containers: docker ps 
  • list all containers (including stopped): docker ps  -a
  • delete specific container: docker rm NAMES
  • delete specific image: docker rmi REPOSITORY:TAG
  • delete ALL containers: docker rm -f $(docker ps -a -q)
  • delete ALL images: docker rmi -f $(docker images -q)

More useful commands can be found here⁠

Official Docker hub docs can be found here⁠

⁠Setup

On your HOST machine (not the Jetson) enter these commands

xhost +

ssh -X jetson@ip_address

On the Jetson, run the following commands

Give the jetson sudo access for docker commands

sudo usermod -aG docker ${USER}

su ${USER}

Check if X_11 forwarding is working

xeyes

If some googly eyes pop up, X_11 is ready to go. IF X_11 PORT FORWARDING IS NOT SETUP, follow steps here⁠ to get it setup. Then come back here to continue the steps below.

Then modify daemon.json file (just delete previous version then create new one)

sudo rm /etc/docker/daemon.json

sudo nano /etc/docker/daemon.json

copy and paste the following into that file:

{
    "runtimes": {
        "nvidia": {
            "path": "nvidia-container-runtime",
            "runtimeArgs": []
        }
    },

    "default-runtime": "nvidia"
}

save and quit then reboot jetson

sudo reboot now

Have 2 terminal windows ready to use on your host Jetson

⁠Running docker container: Terminal 1

Run the following command (yes, thats just 1 command)

docker run --name name_this_container -it --privileged --net=host -e DISPLAY=$DISPLAY --device /dev/video0 --volume="$HOME/.Xauthority:/root/.Xauthority:rw" djnighti/ucsd_robocar:latest

NOTE: where "name_this_container" can be anything you want

⁠Running docker container: Terminal 2 (ONLY NECCESSARY IF USING ROS-NOETIC or using ROS-Bridge IE. ucsd_robocar_hub_1 independently or both ucsd_robocar_hub_1 and ucsd_robocar_hub_2)

Run the following commands

docker exec -it name_this_container bash

source /opt/ros/noetic/setup.bash

roscore

REMINDER: where "name_this_container" can be anything you want BUT MUST MATCH THE SAME NAME GIVEN WHEN ENTERED IN TERMINAL 1

⁠Go back to Terminal 1

Now follow the instructions here⁠ for how to proceed with using ROS-NOETIC related packages.

Now follow the instructions here⁠ for how to proceed with using ROS2-FOXY related packages.

⁠Workspaces

⁠ros1_ws

ROS version: ROS-NOETIC

This workspace contains source compiled packages from ucsd_robocar_hub1⁠

⁠ros2_ws

ROS version: ROS2-FOXY

This workspace contains source compiled packages from ucsd_robocar_hub2⁠

⁠sensor_ws

ROS version: ROS2-FOXY

This workspace contains source compiled packages for various sensors in our inventory.

⁠f110_ws

ROS version: ROS-NOETIC

Main usage is that there packages integrated vesc messages to work with the joystick node for manual control

⁠ROS BRIDGE

The ros1_bridge package is used to enable the communication between nodes in ROS1 (ros1_ws) and ROS2 (ros2_ws). Reading material on how to use it can be found here⁠ and a video of it being used can be found here⁠

REMEMBER: This image has both ROS1 and ROS2 which results in having to source them individually and every new terminal. This also means that the metapackages ucsd_robocar_hub1 and ucsd_robocar_hub2 must be sourced!

NOTE: Notice the difference in the files paths for each workspace below for how to source everything properly

For ROS1

root@ucsd-jetson:/home/projects/ros1_ws# source /opt/ros/noetic/setup.bash

root@ucsd-jetson:/home/projects/ros1_ws# source devel/setup.bash

For ROS2

root@ucsd-jetson:/home/projects/ros2_ws# source /opt/ros/foxy/setup.bash

root@ucsd-jetson:/home/projects/ros2_ws# source install/setup.bash

⁠Jetpack info for Jetson:

REQUIREMENT: JetPack 4.6 (L4T R32.6.1)

check to make sure: sudo apt-cache show nvidia-jetpack

Tag summary

Content type

Image

Digest

Size

1.8 GB

Last updated

over 4 years ago

docker pull djnighti/ucsd_robocar