Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin' into MockRoll
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackack committed Mar 5, 2024
2 parents 01cd578 + 3b927c2 commit e2821c0
Show file tree
Hide file tree
Showing 586 changed files with 272 additions and 63,727 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ rb_ws/bags
.python-requirements.txt.un~
docker-compose.yml~
python-requirements.txt~
*TEMP_DO_NOT_EDIT.txt
rb_ws/src/buggy/bags/2023-02-11-11-38-44.bag
rb_ws/src/buggy/bags/2023-02-11-12-00-49.bag
rb_ws/src/buggy/bags/2023-02-11-12-01-12.bag
Expand Down
27 changes: 13 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ A complete re-write of the old RoboBuggy.
### ROS
- Navigate to `/rb_ws`. This is the catkin workspace where we will be doing all our ROS stuff.
- To build the ROS workspace and source it, run:

catkin_make
source /rb_ws/devel/setup.bash # sets variables so that our package is visible to ROS commands
- To learn ROS on your own, follow the guide on https://wiki.ros.org/ROS/Tutorials. Start from the first and install Ros using a Virtual Machine.
Expand All @@ -55,31 +55,30 @@ A complete re-write of the old RoboBuggy.
### ROS
- Navigate to `/rb_ws`. This is the catkin workspace where we will be doing all our ROS stuff.
- To build the ROS workspace and source it, run:

catkin_make
source /rb_ws/devel/setup.bash # sets variables so that our package is visible to ROS commands
- To learn ROS on your own, follow the guide on https://wiki.ros.org/ROS/Tutorials. Start from the first and install Ros using a Virtual Machine.

---
## Open Docker
## Open Docker
- Use `cd` to change the working directory to be `RoboBuggy2`
- Then do `./setup_dev.sh` in the main directory (RoboBuggy2) to launch the docker container.
- Then do `./setup_dev.sh` in the main directory (RoboBuggy2) to launch the docker container. Utilize the `--no-gpu`, `--force-gpu`, and `--run-testing` flags as necessary.
- Then you can go in the docker container using the `docker exec -it robobuggy2-main-1 bash`.
- When you are done, type Ctrl+C and use `$exit` to exit.

## 2D Simulation
- Boot up the docker container
- Run `roslaunch buggy sim_2d_single.launch` to simulate 1 buggy
- Run `roslaunch buggy sim_2d_single.launch` to simulate 1 buggy
- See `rb_ws/src/buggy/launch/sim_2d_single.launch` to view all available launch options

- Run `roslaunch buggy sim_2d_2buggies.launch` to simulate 2 buggies
- <img width="612" alt="Screenshot 2023-11-13 at 3 18 30 PM" src="https://github.com/CMU-Robotics-Club/RoboBuggy2/assets/45720415/b204aa05-8792-414e-a868-6fbc0d11ab9d">

<img width="612" alt="Screenshot 2023-11-13 at 3 18 30 PM" src="https://github.com/CMU-Robotics-Club/RoboBuggy2/assets/45720415/b204aa05-8792-414e-a868-6fbc0d11ab9d">

- See `rb_ws/src/buggy/launch/sim_2d_2buggies.launch` to view all available launch options
- To prevent topic name collision, a topic named `t` associated with buggy named `x` have format `x\t`. The
- names are `SC` and `Nand` in the 2 buggy simulator. In the one buggy simulator, the name can be defined as a launch arg.
- See [**Foxglove Visualization**](#foxglove-visualization) for visualizing the simulation. Beware that since topic names
- are user-defined, you will need to adjust the topic names in each panel.
- The buggy starting positions can be changed using the `sc_start_pos` and `nand_start_pos` arguments (can pass as a key to a dictionary of preset start positions in engine.py, a single float for starting distance along planned trajectory, or 3 comma-separated floats (utm east, utm north, and heading))
- To prevent topic name collision, a topic named `t` associated with buggy named `x` have format `x/t`. The names are `SC` and `Nand` in the 2 buggy simulator. In the one buggy simulator, the name can be defined as a launch arg.
- See [**Foxglove Visualization**](#foxglove-visualization) for visualizing the simulation. Beware that since topic names are user-defined, you will need to adjust the topic names in each panel.

### Simulator notes
Feedback:
Expand All @@ -90,7 +89,7 @@ Commands:
- Steering angle: `/buggy/steering` in degrees (std_msgs/Float64)
- Velocity: `/buggy/velocity` in m/s (std_msgs/Float64)


## Foxglove Visualization
- Foxglove is used to visualize both the simulator and the actual buggy's movements.
- First, you need to import the layout definition into Foxglove. On the top bar, click Layout, then "Import from file".
Expand All @@ -114,12 +113,12 @@ Instructions:
### Connecting to and Launching the RoboBuggy
When launching the buggy:
- Connect to the Wi-Fi named ShortCircuit.
- In the command line window:
- In the command line window:
SSH to the computer on ShortCircuit and go to folder
`$ ssh [email protected]`
Then `$ cd RoboBuggy2`
- Setup the docker
`$ ./setup_prod.sh`
`$ ./setup_prod.sh` (Utilize the `--no-gpu`, `--force-gpu`, and `--run-testing` flags as necessary.)
- Go to docker container
`$ docker_exec`
- Open foxglove and do local connection to “ws://192.168.1.217/8765”
Expand Down
52 changes: 52 additions & 0 deletions docker-compose-gpu-automated-testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
services:
main:
build: .
volumes:
- ./rb_ws:/rb_ws
- "${RLSENSE_PORT:-/dev/null}:/dev/bus/usb"
- /tmp/.X11-unix:/tmp/.X11-unix
devices:
- "${TEENSY_PORT:-/dev/null}:/dev/ttyUSB0"
- "${WEBCAM_PORT:-/dev/null}:/dev/ttyUSB1"
- "${GPS_PORT:-/dev/null}:/dev/ttyACM0"
- "${FEATHER_PORT:-/dev/null}:/dev/ttyACM1"
stdin_open: true # docker run -i
tty: true # docker run -t
environment:
- DISPLAY=host.docker.internal:0
hostname: main
ports:
- "0.0.0.0:8765:8765" # foxglove bridge
- "0.0.0.0:8760:8760" # Asset server for loading stuff into foxglove
platform: "linux/amd64"
device_cgroup_rules:
- "c *:* rmw"
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 'all'
capabilities: [gpu]
tileserver:
image: maptiler/tileserver-gl
volumes:
- "./maps:/data"
stdin_open: true # docker run -i
tty: true # docker run -t
command: ["-p", "80", "-c", "/data/conf.json"]
ports:
- "8080:80"
tester:
build: .
volumes:
- ./rb_ws:/rb_ws
- /tmp/.X11-unix:/tmp/.X11-unix
stdin_open: true # docker run -i
tty: true # docker run -t
environment:
- DISPLAY=host.docker.internal:0
hostname: tester
platform: "linux/amd64"
device_cgroup_rules:
- "c *:* rmw"
1 change: 1 addition & 0 deletions docker-compose-gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ services:
tty: true # docker run -t
environment:
- DISPLAY=host.docker.internal:0
hostname: main
ports:
- "0.0.0.0:8765:8765" # foxglove bridge
- "0.0.0.0:8760:8760" # Asset server for loading stuff into foxglove
Expand Down
45 changes: 45 additions & 0 deletions docker-compose-no-gpu-automated-testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
services:
main:
build: ./docker_auton
volumes:
- ./rb_ws:/rb_ws
- "${RLSENSE_PORT:-/dev/null}:/dev/bus/usb"
- /tmp/.X11-unix:/tmp/.X11-unix
devices:
- "${TEENSY_PORT:-/dev/null}:/dev/ttyUSB0"
- "${WEBCAM_PORT:-/dev/null}:/dev/ttyUSB1"
- "${GPS_PORT:-/dev/null}:/dev/ttyACM0"
- "${FEATHER_PORT:-/dev/null}:/dev/ttyACM1"
stdin_open: true # docker run -i
tty: true # docker run -t
environment:
- DISPLAY=host.docker.internal:0
hostname: main
ports:
- "0.0.0.0:8765:8765" # foxglove bridge
- "0.0.0.0:8760:8760" # Asset server for loading stuff into foxglove
platform: "linux/amd64"
device_cgroup_rules:
- "c *:* rmw"
tileserver:
image: maptiler/tileserver-gl
volumes:
- "./maps:/data"
stdin_open: true # docker run -i
tty: true # docker run -t
command: ["-p", "80", "-c", "/data/conf.json"]
ports:
- "8080:80"
tester:
build: ./docker_tester
volumes:
- ./rb_ws:/rb_ws
- /tmp/.X11-unix:/tmp/.X11-unix
stdin_open: true # docker run -i
tty: true # docker run -t
environment:
- DISPLAY=host.docker.internal:0
hostname: tester
platform: "linux/amd64"
device_cgroup_rules:
- "c *:* rmw"
3 changes: 2 additions & 1 deletion docker-compose-no-gpu.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
main:
build: .
build: ./docker_auton
volumes:
- ./rb_ws:/rb_ws
- "${RLSENSE_PORT:-/dev/null}:/dev/bus/usb"
Expand All @@ -14,6 +14,7 @@ services:
tty: true # docker run -t
environment:
- DISPLAY=host.docker.internal:0
hostname: main
ports:
- "0.0.0.0:8765:8765" # foxglove bridge
- "0.0.0.0:8760:8760" # Asset server for loading stuff into foxglove
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile → docker_auton/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ RUN apt-get install -y -qq \
ros-noetic-realsense2-description

# Run this now to cache it separately from other requirements
COPY cuda-requirements.txt cuda-requirements.txt
RUN pip3 install -r cuda-requirements.txt
COPY cuda-requirements_TEMP_DO_NOT_EDIT.txt cuda-requirements.txt
# RUN pip3 install -r cuda-requirements.txt


COPY python-requirements.txt python-requirements.txt
COPY python-requirements_TEMP_DO_NOT_EDIT.txt python-requirements.txt
RUN pip3 install -r python-requirements.txt

RUN echo 'source "/opt/ros/$ROS_DISTRO/setup.bash" --' >> ~/.bashrc
Expand Down
36 changes: 36 additions & 0 deletions docker_tester/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
FROM nvidia/cuda:11.6.2-base-ubuntu20.04 as CUDA

FROM osrf/ros:noetic-desktop-full-focal

COPY --from=CUDA /usr/local/cuda /usr/local/


RUN apt update
RUN apt-get install -y -qq \
python3-pip \
python3-tk \
vim git tmux tree sl htop x11-apps

RUN apt-get install -y -qq \
ros-noetic-rosserial \
ros-noetic-foxglove-bridge \
ros-noetic-microstrain-inertial-driver \
ros-noetic-realsense2-camera \
ros-noetic-realsense2-description \
iputils-ping

COPY python-requirements_TEMP_DO_NOT_EDIT.txt python-requirements.txt
RUN pip3 install -r python-requirements.txt

RUN echo 'source "/opt/ros/$ROS_DISTRO/setup.bash" --' >> ~/.bashrc
RUN echo 'cd rb_ws' >> ~/.bashrc
RUN echo 'catkin_make >/dev/null' >> ~/.bashrc
RUN echo 'source devel/setup.bash' >> ~/.bashrc
RUN echo 'export ROS_MASTER_URI=http://main:11311' >> ~/.bashrc

# shoestring fix since installing numba from pythonrequirements
# smh breaks
RUN pip3 install numba

# add mouse to tmux
RUN echo 'set -g mouse on' >> ~/.tmux.conf
3 changes: 0 additions & 3 deletions firmware/README.md

This file was deleted.

28 changes: 0 additions & 28 deletions firmware/libraries/Rosserial_Arduino_Library/Dockerfile

This file was deleted.

52 changes: 0 additions & 52 deletions firmware/libraries/Rosserial_Arduino_Library/examples/ADC/ADC.pde

This file was deleted.

This file was deleted.

Loading

0 comments on commit e2821c0

Please sign in to comment.