Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve dockerfile bashrc config readability #120

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
b34c692
removed all files
mehulgoel873 Oct 10, 2024
9a8ba62
docker setup
mehulgoel873 Oct 16, 2024
95d1b84
created helllo world node
mehulgoel873 Oct 16, 2024
01bb6bd
added old files
mehulgoel873 Oct 16, 2024
c55cd63
autobuild and first node
mehulgoel873 Oct 16, 2024
11ff872
added launch files
mehulgoel873 Oct 16, 2024
99e2249
added readme
mehulgoel873 Oct 16, 2024
6a8491a
changed pylint rc file
mehulgoel873 Oct 17, 2024
6280bc3
pylint fix 1
mehulgoel873 Oct 17, 2024
7ebbd5c
Merge pull request #1 from CMU-Robotics-Club/repo-setup
mehulgoel873 Oct 17, 2024
79879a8
basic node setup
TiaSinghania Oct 21, 2024
1043ab8
added publisher
TiaSinghania Oct 22, 2024
858196f
implemented callback in loop with timer
TiaSinghania Oct 23, 2024
b9c8231
publish/subscriber base code
TiaSinghania Oct 23, 2024
a8e4151
naive translation (ros1 -> ros2)
TiaSinghania Oct 23, 2024
f009cce
initial watchdog node commit
mehulgoel873 Oct 24, 2024
98e5912
added subscriber and fixed
mehulgoel873 Oct 24, 2024
ead0cbe
Finished subscriber
mehulgoel873 Oct 24, 2024
3bb264f
pylint
mehulgoel873 Oct 24, 2024
0a2d85e
Merge pull request #2 from CMU-Robotics-Club/heartbeat
TiaSinghania Oct 24, 2024
d7ede11
initial commit for buggy_state_converter
saransh323 Oct 24, 2024
97191d0
the dots move now
TiaSinghania Oct 29, 2024
a62da31
added command line args
TiaSinghania Oct 29, 2024
96bcb33
Merge branch 'main' into sim-rewrite
TiaSinghania Oct 30, 2024
c256d12
pylint
TiaSinghania Oct 30, 2024
e709012
Merge branch 'sim-rewrite' of https://github.com/CMU-Robotics-Club/ro…
TiaSinghania Oct 30, 2024
fd52cbd
got rid of duplicate
TiaSinghania Oct 30, 2024
b2c1a37
added NAND-self and SC-other functionality
saransh323 Oct 30, 2024
c3790b1
fix transformer epsg code
saransh323 Oct 30, 2024
d2d311e
changed published ros msg fields
saransh323 Nov 6, 2024
f187fab
changed quaternion to yaw conversion
saransh323 Nov 6, 2024
0800563
Merge pull request #3 from CMU-Robotics-Club/sim-rewrite
mehulgoel873 Nov 12, 2024
201744a
merge branch 'main' into buggy-state-converter-rewrite
saransh323 Nov 20, 2024
7f92845
changed message structure handling
saransh323 Nov 20, 2024
d728740
added node to sim file
saransh323 Nov 20, 2024
c34e0bb
fixed ros package errors
saransh323 Nov 21, 2024
24d29fb
pylint *sigh*
saransh323 Nov 25, 2024
5ae86cb
Ported ros_to_bnyahaj.py
rk012 Dec 1, 2024
86da93c
ditch tf_transformations for scipy rotation
saransh323 Dec 4, 2024
ed35e5a
Removed pose/world.py, updated ros_to_bnyahaj.py
rk012 Dec 11, 2024
48a477e
fixed namespaces
saransh323 Dec 15, 2024
a57c316
Removed import alias for SciPy Rotation in ros_to_bnyahaj.py, fixed p…
rk012 Dec 18, 2024
55c4cae
cleanup
TiaSinghania Dec 19, 2024
2959138
cleaned up constants class
TiaSinghania Dec 19, 2024
2aba16d
initial setup
mehulgoel873 Dec 22, 2024
d610f82
wrote init_check, based on old trajectory (slightly modified)
mehulgoel873 Dec 22, 2024
78d6ec7
finished controller node
mehulgoel873 Dec 24, 2024
15496e6
small modif
mehulgoel873 Dec 24, 2024
a537b88
rearranged subscribers/publishers
TiaSinghania Dec 24, 2024
a5a6ab5
changed units to match clean_slate type (utm)
TiaSinghania Dec 24, 2024
b10857f
almost done with compute control
mehulgoel873 Dec 25, 2024
f495ddc
finished stanley controller
mehulgoel873 Dec 25, 2024
fdf7a3a
finished for now
mehulgoel873 Dec 29, 2024
1a8bbfe
Merge pull request #6 from CMU-Robotics-Club/engine-rewrite
mehulgoel873 Dec 29, 2024
6be8426
Merge pull request #5 from CMU-Robotics-Club/ros2bnyahaj_porting
mehulgoel873 Dec 29, 2024
bd5abd7
Merge branch 'main' into buggy-state-converter-rewrite
mehulgoel873 Dec 29, 2024
d2064c8
Merge pull request #4 from CMU-Robotics-Club/buggy-state-converter-re…
mehulgoel873 Dec 29, 2024
6d097cf
Merge branch 'main' into controller
mehulgoel873 Dec 29, 2024
19a1815
debugging, nearly done
mehulgoel873 Dec 31, 2024
cac2ec7
pylint pt. 1
mehulgoel873 Jan 5, 2025
354330b
pylint??
mehulgoel873 Jan 5, 2025
fa64058
fixed for python 3.8
mehulgoel873 Jan 5, 2025
fcfefca
removed trailing whitespace
mehulgoel873 Jan 5, 2025
d6eda8a
review fixes
mehulgoel873 Jan 7, 2025
88a2acd
fixed gitignore
mehulgoel873 Jan 7, 2025
e53769d
Telematics Rewrite (#11)
rk012 Jan 7, 2025
7c3cb77
Controller (#10)
TiaSinghania Jan 8, 2025
d3a09e8
serial port with updated packet structure (#13)
TiaSinghania Jan 10, 2025
07d062c
Path planner (#14)
mehulgoel873 Jan 11, 2025
669ae89
Config file (#15)
mehulgoel873 Jan 14, 2025
2049949
added env vars to docker (#17)
TiaSinghania Jan 14, 2025
c335660
Updated Dockerfile .bashrc creation to be more readable
BruceMcRooster Jan 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .env.dev
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# NOTE: this file is not being used in docker compose correctly
# SET ALL ENVIRONMENT VARIABLES IN THE YAML
GPS_PORT=/dev/null
WEBCAM_PORT=/dev/null
RLSENSE_PORT=/dev/null
TEENSY_PORT=/dev/null
FEATHER_PORT=/dev/null

6 changes: 0 additions & 6 deletions .env.prod

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ jobs:
echo "No files to lint"
else
echo "Running Linter!"
pylint --rc-file=/home/runner/work/RoboBuggy2/RoboBuggy2/.github/workflows/.pylintrc $tmp_pfiles
pylint --rc-file=/home/runner/work/robobuggy-software/robobuggy-software/.github/workflows/.pylintrc $tmp_pfiles
fi
23 changes: 10 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
.DS_Store
rb_ws/bags
.docker-compose.yml.un~
.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
rb_ws/src/buggy/bags/2023-02-12-11-39-27.bag
rb_ws/src/buggy/bags/2023-02-18-02-23-26.bag
rb_ws/src/buggy/bags/2023-02-19-11-21-56.bag
rb_ws/src/buggy/bags/2023-02-19-11-27-49.bag
rb_ws/src/buggy/bags/2023-02-19-11-38-48.bag
rb_ws/src/buggy/bags/*
rb_ws/src/buggy/launch/.main.launch.swp
*.bag

# BAGS
rb_ws/bags
rb_ws/src/buggy/bags/
*.bag
rb_ws/rosbag2/

# VISION
.vision/
vision/data/
34 changes: 34 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# FROM nvidia/cuda:11.6.2-base-ubuntu20.04 as CUDA

FROM ros:humble

# 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-${ROS_DISTRO}-foxglove-bridge \
ros-${ROS_DISTRO}-microstrain-inertial-driver \
ros-${ROS_DISTRO}-mavros ros-${ROS_DISTRO}-mavros-extras ros-${ROS_DISTRO}-mavros-msgs

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

# ABSOLUTELY DO NOT use single quotes inside this block
# end any new lines with "\n\" (no quotes)
RUN printf '\n# automatically generated by Dockerfile \n\
source "/opt/ros/humble/setup.bash" -- \n\
cd rb_ws \n\
colcon build --symlink-install \n\
source install/local_setup.bash \n\
chmod -R +x src/buggy/scripts/ \n\
source environments/docker_env.bash \n\
\n' >> ~/.bashrc

# add mouse to tmux
RUN echo 'set -g mouse on' >> ~/.tmux.conf
46 changes: 9 additions & 37 deletions README.md
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
# RoboBuggy2
A complete re-write of the old RoboBuggy. This code was run for RD23, RD24 and RD25, on both NAND and Short Circuit.
# robobuggy-software
A complete re-write of the old RoboBuggy2. This code was run for RD25, on both NAND and Short Circuit.


## Table of Contents
- Installation and Initial Setup
- Launching Code
- Infrastructure Documentation
- Code Structure and Documentation


---
## Installation and Initial Setup
Expand All @@ -31,34 +28,24 @@ A complete re-write of the old RoboBuggy. This code was run for RD23, RD24 and R
- https://git-scm.com/downloads

### Install Softwares: WSL, Ubuntu (Windows only)
- Go to Microsoft Store to install "Ubuntu 20.04.6 LTS".

### Set up repo in WSL
- To set up ssh key, follow this link: [Connecting to GitHub with SSH](https://docs.github.com/en/authentication/connecting-to-github-with-ssh).
- Note: Ensure that the SSH keys are generated while in the WSL terminal
- In the website above, see these two pages: [Generating a new SSH key and adding it to the ssh-agent](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent) and ["Adding a new SSH key to your GitHub account"](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account).
- Go to Microsoft Store to install "Ubuntu 22.04 LTS".


### Apple Silicon Mac Only:
- In Docker Desktop App: go to settings -> general and turn on "Use Rosetta for x86/amd64 emulation on Apple Silicon"

### Set up repository
- To set up ssh key, follow this link: [Connecting to GitHub with SSH](https://docs.github.com/en/authentication/connecting-to-github-with-ssh).
- Note: Ensure that the SSH keys are generated while in the terminal
- In the website above, see these two pages: [Generating a new SSH key and adding it to the ssh-agent](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent) and ["Adding a new SSH key to your GitHub account"](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account).


### Clone the Repository
This is so you can edit our codebase locally, and sync your changes with the rest of the team through Git.
- In your terminal type: `$ git clone https://github.com/CMU-Robotics-Club/RoboBuggy2.git`.
- In your terminal type: `$ git clone https://github.com/CMU-Robotics-Club/robobuggy-software.git`.
- The clone link above is the URL or can be found above: code -> local -> Clone HTTPS.


### Foxglove Visualization
### Foxglove Visualization (WIP)
- 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".
- ![image](https://github.com/CMU-Robotics-Club/RoboBuggy2/assets/116482510/2aa04083-46b3-42a5-bcc1-99cf7ccdb3d2)
- Go to RoboBuggy2 and choose the file [telematics layout](telematics_layout.json)
- Go to repository and choose the file [telematics layout](telematics_layout.json)
- To visualize the simulator, launch the simulator and then launch Foxglove and select "Open Connection" on startup.
- Use this address `ws://localhost:8765` for Foxglove Websocket
- Open Foxglove, choose the third option "start link".
Expand All @@ -77,9 +64,9 @@ This is so you can edit our codebase locally, and sync your changes with the res

## Launching Code
### Open Docker
- Use `cd` to change the working directory to be `RoboBuggy2`
- Use `cd` to change the working directory to be `robobuggy-software`
- 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`.
- Then you can go in the docker container using the `docker exec -it robobuggy-software-main-1 bash`.
- When you are done, type Ctrl+C and use `$exit` to exit.

### ROS
Expand All @@ -89,7 +76,7 @@ This is so you can edit our codebase locally, and sync your changes with the res
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.

### 2D Simulation
### 2D Simulation (WIP - Doesn't Exist)
- Boot up the docker container
- 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
Expand Down Expand Up @@ -127,18 +114,3 @@ When shutting down the buggy:
`$ exit`
- Shutdown the ShortCircuit computer
`$ sudo shutdown now`

## Documentation
### Infrastructure Documentation
Ask Software Lead (WIP)

### Simulator notes
- Longitude + Latitude for Foxglove visualization on map: `/state/pose_navsat` (sensor_msgs/NavSatFix)
- UTM coordinates (assume we're in Zone 17N): `/sim_2d/utm` (geometry_msgs/Pose - position.x = Easting meters , position.y = Northing meters, position.z = heading in degrees from East axis + is CCW)
- INS Simulation: `/nav/odom` (nsg_msgs/Odometry) (**Noise** is implemented to vary ~1cm)
Commands:
- Steering angle: `/buggy/steering` in degrees (std_msgs/Float64)
- Velocity: `/buggy/velocity` in m/s (std_msgs/Float64)

### Auton Logic
Ask someone with experience (WIP)
144 changes: 144 additions & 0 deletions README_ROBOBUGGY2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
# RoboBuggy2
A complete re-write of the old RoboBuggy. This code was run for RD23, RD24 and RD25, on both NAND and Short Circuit.


## Table of Contents
- Installation and Initial Setup
- Launching Code
- Infrastructure Documentation
- Code Structure and Documentation


---
## Installation and Initial Setup
### Necessary + Recommended Software
- Docker
- Foxglove
- VSCode (recommended)
- Git (recommended)


### Docker
- Installation instructions here: https://docs.docker.com/get-docker/

### Foxglove
- Installation instructions here: https://foxglove.dev/

### VSCode
- https://code.visualstudio.com/download

### Git
- https://git-scm.com/downloads

### Install Softwares: WSL, Ubuntu (Windows only)
- Go to Microsoft Store to install "Ubuntu 20.04.6 LTS".

### Set up repo in WSL
- To set up ssh key, follow this link: [Connecting to GitHub with SSH](https://docs.github.com/en/authentication/connecting-to-github-with-ssh).
- Note: Ensure that the SSH keys are generated while in the WSL terminal
- In the website above, see these two pages: [Generating a new SSH key and adding it to the ssh-agent](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent) and ["Adding a new SSH key to your GitHub account"](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account).


### Apple Silicon Mac Only:
- In Docker Desktop App: go to settings -> general and turn on "Use Rosetta for x86/amd64 emulation on Apple Silicon"

### Set up repository
- To set up ssh key, follow this link: [Connecting to GitHub with SSH](https://docs.github.com/en/authentication/connecting-to-github-with-ssh).
- Note: Ensure that the SSH keys are generated while in the terminal
- In the website above, see these two pages: [Generating a new SSH key and adding it to the ssh-agent](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent) and ["Adding a new SSH key to your GitHub account"](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account).


### Clone the Repository
This is so you can edit our codebase locally, and sync your changes with the rest of the team through Git.
- In your terminal type: `$ git clone https://github.com/CMU-Robotics-Club/RoboBuggy2.git`.
- The clone link above is the URL or can be found above: code -> local -> Clone HTTPS.


### 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".
- ![image](https://github.com/CMU-Robotics-Club/RoboBuggy2/assets/116482510/2aa04083-46b3-42a5-bcc1-99cf7ccdb3d2)
- Go to RoboBuggy2 and choose the file [telematics layout](telematics_layout.json)
- To visualize the simulator, launch the simulator and then launch Foxglove and select "Open Connection" on startup.
- Use this address `ws://localhost:8765` for Foxglove Websocket
- Open Foxglove, choose the third option "start link".
- ![image](https://github.com/CMU-Robotics-Club/RoboBuggy2/assets/116482510/66965d34-502b-4130-976e-1419c0ac5f69)



### X11 Setup (recommended)
- Install the appropriate X11 server on your computer for your respective operating systems (Xming for Windows, XQuartz for Mac, etc.).
- Mac: In XQuartz settings, ensure that the "Allow connections from network clients" under "Security" is checked.
- Windows: Make sure that you're using WSL 2 Ubuntu and NOT command prompt.
- While in a bash shell with the X11 server running, run `xhost +local:docker`.
- Boot up the docker container using the "Alternate Shortcut" above.
- Run `xeyes` while INSIDE the Docker container to test X11 forwarding. If this works, we're good.


## Launching Code
### 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. 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.

### ROS
- Navigate to `/rb_ws`. This is the catkin workspace where we will be doing all our ROS stuff.
- (This should only need to be run the first time you set up the repository) - 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.

### 2D Simulation
- Boot up the docker container
- 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">

- See `rb_ws/src/buggy/launch/sim_2d_2buggies.launch` to view all available launch options
- 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.

### Connecting to and Launching the RoboBuggies
When launching Short Circuit:
- Connect to the Wi-Fi named ShortCircuit.
- 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` (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”
- Roslauch in docker container by `$ roslaunch buggy sc-main.launch`
(wait until no longer prints “waiting for covariance to be better”)

When launching NAND:
- Ask software lead (WIP)

When shutting down the buggy:
- Stop roslauch
`$ ^C (Ctrl+C)`
- Leave the docker container
`$ exit`
- Shutdown the ShortCircuit computer
`$ sudo shutdown now`

## Documentation
### Infrastructure Documentation
Ask Software Lead (WIP)

### Simulator notes
- Longitude + Latitude for Foxglove visualization on map: `/state/pose_navsat` (sensor_msgs/NavSatFix)
- UTM coordinates (assume we're in Zone 17N): `/sim_2d/utm` (geometry_msgs/Pose - position.x = Easting meters , position.y = Northing meters, position.z = heading in degrees from East axis + is CCW)
- INS Simulation: `/nav/odom` (nsg_msgs/Odometry) (**Noise** is implemented to vary ~1cm)
Commands:
- Steering angle: `/buggy/steering` in degrees (std_msgs/Float64)
- Velocity: `/buggy/velocity` in m/s (std_msgs/Float64)

### Auton Logic
Ask someone with experience (WIP)
Loading