Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
123 commits
Select commit Hold shift + click to select a range
60f2ab3
update dockerfile base image
TagCiccone May 22, 2026
351feb8
remove wsl stuff from hardware container
TagCiccone May 22, 2026
abdadd4
remove unneeded deps from container
TagCiccone May 22, 2026
9b83124
some experimenting with zed stuff
TagCiccone May 27, 2026
e2f6c80
IT DRIVES!
TagCiccone May 28, 2026
2dff9a0
downgrade ros2 version to humble
zbrotherton May 29, 2026
5578612
checkpoint
zbrotherton May 29, 2026
c0e91b0
Signal light interaction w/ enable and disable (#132)
TagCiccone May 29, 2026
90ead7e
Feature/igvc estop (#133)
zbrotherton May 29, 2026
ca12cb4
add microcontroller LED code
May 29, 2026
f09b749
reinstate hardware launch
zbrotherton May 29, 2026
c4c4489
remove adimu
zbrotherton May 29, 2026
2eba9ee
fix hardware launch formatting
zbrotherton May 29, 2026
122989e
add lidar launch arguments
zbrotherton May 29, 2026
fb0d3c2
Add .items to rplidar node
zbrotherton May 29, 2026
9a7b6d0
remove oak from camera.urdf.xacro
zbrotherton May 30, 2026
b60bb17
Feature/rtabmap yaml (#134)
zbrotherton May 30, 2026
96b4c7b
change rtab sim time to false
zbrotherton May 30, 2026
037090f
add estop and led bridge to bringups
TagCiccone May 30, 2026
b372f26
add output screen
TagCiccone May 30, 2026
bbbe4ef
add gpio debug statements
zbrotherton May 30, 2026
6bf3677
invert estop enabled message behaviour
zbrotherton May 30, 2026
2f52321
change estop logs to fstrings
zbrotherton May 30, 2026
e0ba084
Merge branch 'competition' of https://github.com/RPI-IGVC-2025/2026Ro…
zbrotherton May 30, 2026
d9ea45c
switch mechanical to active high
zbrotherton May 30, 2026
2c5551f
Add robot description remap to controllers manager
zbrotherton May 30, 2026
cb07408
Merge branch 'competition' of https://github.com/RPI-IGVC-2025/Hardwa…
zbrotherton May 30, 2026
12485c9
change when estop publishes enabled
zbrotherton May 30, 2026
cc1a667
Merge branch 'competition' of https://github.com/RPI-IGVC-2025/2026Ro…
zbrotherton May 30, 2026
8ceb1fe
add zed camera link to description
zbrotherton May 30, 2026
f5a4295
Merge branch 'competition' of https://github.com/RPI-IGVC-2025/2026Ro…
zbrotherton May 30, 2026
61d82b5
Add zed to URDF
zbrotherton May 30, 2026
0801788
Merge branch 'competition' of https://github.com/RPI-IGVC-2025/2026Ro…
zbrotherton May 30, 2026
0925a1b
Change zed wrapper to description
zbrotherton May 30, 2026
74fb9ea
Merge branch 'competition' of https://github.com/RPI-IGVC-2025/2026Ro…
zbrotherton May 30, 2026
6053f65
add dummy origin to zed to stop crash
zbrotherton May 30, 2026
9d37e74
Merge branch 'competition' of https://github.com/RPI-IGVC-2025/2026Ro…
zbrotherton May 30, 2026
9a901a4
add remap to controller spawner
zbrotherton May 30, 2026
f78cf8c
Merge branch 'competition' of https://github.com/RPI-IGVC-2025/2026Ro…
zbrotherton May 30, 2026
e09b087
remove tf from zed launch
zbrotherton May 30, 2026
1302088
change rtab frame to base link
zbrotherton May 30, 2026
8ca83e9
change rgbd odometry frame id to base link
zbrotherton May 30, 2026
b8da146
Change rtabmap camera info topics
zbrotherton May 30, 2026
8268963
change rtab odom frame id
zbrotherton May 30, 2026
0584f97
change sensor angles
zbrotherton May 30, 2026
5dd1773
change zed positioning
zbrotherton May 30, 2026
d56eb39
remove placeholder camera positions
zbrotherton May 30, 2026
b116a34
add imu topic remap
zbrotherton May 30, 2026
a648cdc
Add navsat node
zbrotherton May 30, 2026
a57ddfa
Fix navsat typo
zbrotherton May 30, 2026
daa1a2b
Change gps node type
zbrotherton May 30, 2026
9f129ed
Feature/igvc cv (#136)
zbrotherton May 30, 2026
94fd38c
Feature/custom node (#135)
zbrotherton May 30, 2026
6e55e0b
create goal setter package
zbrotherton May 31, 2026
d231c84
change serial port on gps
zbrotherton May 31, 2026
6c9bbe6
igvc goal node (#138)
zbrotherton May 31, 2026
4e70a0c
fix cv package
zbrotherton May 31, 2026
28a4003
Rewrite cv setup
zbrotherton May 31, 2026
0fd29a2
change cv package name in setup
zbrotherton May 31, 2026
9c3bbcc
correct cv + gps topics
zbrotherton May 31, 2026
bf24c6c
add uv scaling
zbrotherton May 31, 2026
0a4f642
remove throttle
zbrotherton May 31, 2026
2a757fd
remove return warn
zbrotherton May 31, 2026
919a0a4
simplify cloud sampling
zbrotherton May 31, 2026
d4240b0
widen parameters
zbrotherton May 31, 2026
dcb5eb0
checkpoint pre-gps node
zbrotherton May 31, 2026
624fabf
Remove YAML anchors
zbrotherton May 31, 2026
ff9e106
change costmap dimensions to ints
zbrotherton May 31, 2026
2270e1d
change all plugin names to humble-style
zbrotherton May 31, 2026
47c6b65
add back in some cpp style plugin names
zbrotherton May 31, 2026
4b952d4
add back wait functionality
zbrotherton May 31, 2026
359abf8
Merge branch 'competition' of https://github.com/RPI-IGVC-2025/Hardwa…
zbrotherton May 31, 2026
fca6289
Remove zed cloud from voxel layer
zbrotherton Jun 1, 2026
327db79
reimplement canny style detection
zbrotherton Jun 1, 2026
46871c1
add config to setup.py
zbrotherton Jun 1, 2026
4a561b2
line detection mostly working
zbrotherton Jun 1, 2026
d518a6d
cv approach 3
zbrotherton Jun 1, 2026
963599d
Revert "cv approach 3"
zbrotherton Jun 1, 2026
fa2045b
line detection at acceptable functionality
zbrotherton Jun 1, 2026
6b2b1dd
add cv to bringup
TagCiccone Jun 1, 2026
28721af
Bridge node for the compass on our gps (#139)
TagCiccone Jun 1, 2026
7c7e73b
modify igvc goal setup
zbrotherton Jun 1, 2026
bc0c2f7
Merge branch 'competition' of https://github.com/RPI-IGVC-2025/Hardwa…
zbrotherton Jun 1, 2026
e847602
remove warn_throttle
zbrotherton Jun 1, 2026
bf979cb
move yaml import somewhere not stupid
TagCiccone Jun 1, 2026
c750dfe
add single gps goal node
zbrotherton Jun 1, 2026
c24c951
Merge branch 'competition' of https://github.com/RPI-IGVC-2025/Hardwa…
zbrotherton Jun 1, 2026
2440480
Add nav2 to bringup
zbrotherton Jun 1, 2026
3fc1c53
enter correct qual waypoint
zbrotherton Jun 1, 2026
7460bcb
change package from placeholders
zbrotherton Jun 1, 2026
7aee8a3
troubleshooting gps
zbrotherton Jun 1, 2026
26bfa86
Change navsat params
zbrotherton Jun 1, 2026
0cdb4ef
Merge branch 'competition' of https://github.com/RPI-IGVC-2025/Hardwa…
zbrotherton Jun 1, 2026
8edbcc9
patch fix for config filepath
zbrotherton Jun 1, 2026
a37039a
switch footprint parameters
zbrotherton Jun 1, 2026
4c6fa16
Update compass_bridge.py
TagCiccone Jun 1, 2026
df0a1c0
Update compass_bridge.py
TagCiccone Jun 1, 2026
fa74906
compass as imu
zbrotherton Jun 1, 2026
d4c0498
change to compass topic
zbrotherton Jun 1, 2026
0c3b56f
Merge branch 'competition' of https://github.com/RPI-IGVC-2025/Hardwa…
zbrotherton Jun 1, 2026
81de8db
change imu name navsat
zbrotherton Jun 1, 2026
5e5f730
rewire cmd_vel
zbrotherton Jun 1, 2026
588644d
cmd_vel_scaler
zbrotherton Jun 1, 2026
088774d
add glob to scaler setup
zbrotherton Jun 1, 2026
e8fbc63
add vel scaler to nav launch
zbrotherton Jun 1, 2026
5b44fd4
remove vel_scaler
zbrotherton Jun 1, 2026
a3e502d
move vel scaler within src
zbrotherton Jun 1, 2026
3ecd3a5
vel scaler back in launch
zbrotherton Jun 1, 2026
4f2965c
change vel scaler package launch path
zbrotherton Jun 1, 2026
915db91
change angular scale
zbrotherton Jun 1, 2026
b4b4df9
pre-fix patch
zbrotherton Jun 1, 2026
6fc3027
change install directory for cv
zbrotherton Jun 1, 2026
22968bb
Merge branch 'competition' of https://github.com/RPI-IGVC-2025/Hardwa…
zbrotherton Jun 1, 2026
5593768
add lane voxel to global
zbrotherton Jun 1, 2026
c5cdaa8
Patch
zbrotherton Jun 1, 2026
e066b29
reverse base_link
zbrotherton Jun 1, 2026
384c694
Merge branch 'competition' of https://github.com/RPI-IGVC-2025/Hardwa…
zbrotherton Jun 1, 2026
756220e
track testing changes
zbrotherton Jun 1, 2026
3d1df2b
set cartesian publishing to false
zbrotherton Jun 1, 2026
614b348
fix typo in plugin
TagCiccone Jun 1, 2026
2823b4c
Checkpoint: Hail Mary
zbrotherton Jun 1, 2026
ad36b64
Merge branch 'competition' of https://github.com/RPI-IGVC-2025/2026Ro…
zbrotherton Jun 1, 2026
1690dab
Zane fix
TagCiccone Jun 1, 2026
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
74 changes: 41 additions & 33 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM ros:jazzy
ARG BASE_IMAGE=ros:humble
FROM ${BASE_IMAGE}
ARG USERNAME=$USERNAME
ARG USER_UID=1000
ARG USER_GID=$USER_UID
Expand Down Expand Up @@ -26,8 +27,7 @@ ENV ENABLE_LIDAR=$LIDAR_ENABLED
RUN if id -u $USER_UID ; then userdel `id -un $USER_UID` ; fi

# Create the user
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
RUN useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
#
# [Optional] Add sudo support. Omit if you don't need to install software after connecting.
&& apt-get update \
Expand All @@ -40,15 +40,16 @@ RUN apt-get update && apt-get upgrade -y
RUN apt-get install -y \
python3-pip \
# CycloneDDS package
ros-jazzy-rmw-cyclonedds-cpp
ros-humble-rmw-cyclonedds-cpp \
libturbojpeg

## Simulation only
RUN if $SIM_ENABLED ; then \
apt-get install -y \
# RQT packages
ros-jazzy-rqt-tf-tree ros-jazzy-rqt-graph ros-jazzy-rqt-image-view \
ros-humble-rqt-tf-tree ros-humble-rqt-graph ros-humble-rqt-image-view \
# Teleop control keyboard
ros-jazzy-teleop-twist-keyboard \
ros-humble-teleop-twist-keyboard \
# External terminal
# TODO: Figure out how to do on mac
gnome-terminal dbus-x11 ; \
Expand Down Expand Up @@ -90,38 +91,45 @@ RUN if $IMU_ENABLED ; then \
fi

## CUDA
RUN if $ZED_DEV_PLATFORM ; then \
apt-get install -y \
zstd pciutils mesa-utils wget gnupg \
# TODOs:
# Figure out mounting CUDA from host
&& if [ ! $MOUNT_CUDA ] ; then \
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/cuda-keyring_1.1-1_all.deb \
&& dpkg -i cuda-keyring_1.1-1_all.deb \
&& apt-get update \
&& apt-get install -y cuda-toolkit-13-0 ; \
fi ; \
# && if [ ! $MOUNT_CUDA ] ; then \
# wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/cuda-keyring_1.1-1_all.deb \
# && dpkg -i cuda-keyring_1.1-1_all.deb \
# && apt-get update \
# && apt-get install -y cuda-toolkit-13-0 ; \
# fi ; \

RUN if $ZED_DEV_PLATFORM ; then \
apt-get install -y \
zstd pciutils mesa-utils wget gnupg ; \
fi

## ZED SDK
RUN if $ZED_DEV_PLATFORM ; then \
# Determine Zed link based on platform
case $PLATFORM in \
LINUX) \
export ZED_LINK="https://download.stereolabs.com/zedsdk/5.2/cu13/ubuntu24" \
;; \
JETSON_ORIN) \
export ZED_LINK="https://download.stereolabs.com/zedsdk/5.2/l4t36.5/jetsons" \
;; \
JETSON_THOR) \
export ZED_LINK="https://download.stereolabs.com/zedsdk/5.2/l4t38.4/jetsons" \
;; \
esac \
# Install SDK
&& wget -O zed_installer.run $ZED_LINK \
&& chmod +x zed_installer.run \
&& ./zed_installer.run -- silent --skip_python --skip_cuda; \
fi
# RUN if $ZED_DEV_PLATFORM ; then \
# # Determine Zed link based on platform
# case $PLATFORM in \
# LINUX) \
# export ZED_LINK="https://download.stereolabs.com/zedsdk/5.2/cu13/ubuntu24" \
# ;; \
# JETSON_ORIN) \
# export ZED_LINK="https://download.stereolabs.com/zedsdk/5.2/l4t36.5/jetsons" \
# ;; \
# JETSON_THOR) \
# export ZED_LINK="https://download.stereolabs.com/zedsdk/5.2/l4t38.4/jetsons" \
# ;; \
# esac \
# # Install SDK
# && wget -O zed_installer.run $ZED_LINK \
# && chmod +x zed_installer.run \
# && ./zed_installer.run -- silent ; \
# fi

# RUN wget -q --no-check-certificate -O ZED_SDK_Linux.run https://download.stereolabs.com/zedsdk/5.2/l4t36.5/jetsons && \
# chmod +x ZED_SDK_Linux.run ; ./ZED_SDK_Linux.run silent skip_tools skip_drivers && \
# rm -rf /usr/local/zed/resources/* \
# rm -rf ZED_SDK_Linux.run && \
# rm -rf /var/lib/apt/lists/*

ENV SHELL /bin/bash

Expand Down
3 changes: 1 addition & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@

],
"mounts": [

"source=/tmp/.X11-unix,target=/tmp/.X11-unix,type=bind,consistency=cached",
"source=/dev/dri,target=/dev/dri,type=bind,consistency=cached"
],
"postCreateCommand": ". .devcontainer/setup.bash && sudo rosdep update --rosdistro=jazzy && sudo rosdep install --from-paths lib src --ignore-src -y --rosdistro=jazzy && sudo chown -R $(whoami) /home/ros2_ws/ && sudo chmod a+rw . -R && (rm -r build/ || true) && colcon build --symlink-install --packages-skip-regex zed_*",
"postCreateCommand": ". .devcontainer/setup.bash && sudo rosdep update --rosdistro=humble && sudo rosdep install --from-paths lib src --ignore-src -y --rosdistro=humble && sudo chown -R $(whoami) /home/ros2_ws/ && sudo chmod a+rw . -R && (rm -r build/ || true) && colcon build --symlink-install --packages-skip-regex zed_*",
"forwardPorts": [8765]
}
23 changes: 13 additions & 10 deletions .devcontainer/hardware/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
"USERNAME": "ros_user",
"PLATFORM": "JETSON_ORIN",
"SIM_ENABLED": "false",
"DEPLOYABLE_BUILD": "true"
"DEPLOYABLE_BUILD": "true",
"BASE_IMAGE": "ros2-l4t:humble-zed",
"IMU_ENABLED": "false"
}
},
"workspaceFolder": "/home/ros2_ws",
Expand Down Expand Up @@ -36,13 +38,14 @@
"NVIDIA_VISIBLE_DEVICES": "all",
"NVIDIA_DRIVER_CAPABILITES": "all",
"WAYLAND_DISPLAY": "${env:WAYLAND_DISPLAY}",
"LD_LIBRARY_PATH": "/usr/lib/wsl/lib",
"MESA_D3D12_DEFAULT_ADAPTER_NAME": "NVIDIA",
"MESA_LOADER_DRIVER_OVERRIDE": "d3d12",
"GALLIUM_DRIVER": "d3d12",
"LIBGL_ALWAYS_INDIRECT": "0"
"LIBGL_ALWAYS_INDIRECT": "0",

},
"ZED_SDK_ROOT_DIR": "/usr/local/zed",
"CUDA_HOME": "/usr/local/cuda"
},
"runArgs": [
"--net=host",
"--pid=host",
Expand All @@ -55,12 +58,12 @@

],
"mounts": [
"source=/dev/dri,target=/dev/dri,type=bind,consistency=cached",
"source=/dev/,target=/dev/,type=bind,consistency=cached",
"source=/tmp/.X11-unix,target=/tmp/.X11-unix,type=bind,consistency=cached",
"source=/usr/lib/wsl,target=/usr/lib/wsl,type=bind,consistency=cached",
"source=/usr/lib/x86_64-linux-gnu/dri,target=/usr/lib/x86_64-linux-gnu/dri,type=bind,consistency=cached",
"source=//usr/share/glvnd,target=/usr/share/glvnd,type=bind,consistency=cached"
"source=//usr/share/glvnd,target=/usr/share/glvnd,type=bind,consistency=cached",
"source=/usr/local/zed,target=/usr/local/zed,type=bind,consistency=cached",
"source=/usr/local/cuda,target=/usr/local/cuda,type=bind,consistency=cached"
],
"postCreateCommand": ". .devcontainer/setup.bash && sudo rosdep update --rosdistro=jazzy && sudo rosdep install --from-paths lib src --ignore-src -y --rosdistro=jazzy && sudo chown -R $(whoami) /home/ros2_ws/ && sudo chmod a+rw . -R && (rm -r build/ || true) && colcon build --symlink-install --packages-skip-regex zed_*",
"postCreateCommand": ". .devcontainer/setup.bash && sudo rosdep update --rosdistro=humble && sudo rosdep install --from-paths lib src --ignore-src -y --rosdistro=humble && sudo chown -R $(whoami) /home/ros2_ws/ && sudo chmod a+rw . -R && (rm -r build/ || true) && colcon build --symlink-install",
"forwardPorts": [8765]
}
}
2 changes: 1 addition & 1 deletion .devcontainer/macos/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@
"runArgs": [
"-p", "5900:5900"
],
"postCreateCommand": ". .devcontainer/setup.bash && sudo rosdep update --rosdistro=jazzy && sudo rosdep install --from-paths lib src --ignore-src -y --rosdistro=jazzy && sudo chown -R $(whoami) /home/ros2_ws/ && sudo chmod a+rw . -R && (rm -r build/ install/ || true) && colcon build --symlink-install --packages-skip-regex zed_*",
"postCreateCommand": ". .devcontainer/setup.bash && sudo rosdep update --rosdistro=humble && sudo rosdep install --from-paths lib src --ignore-src -y --rosdistro=humble && sudo chown -R $(whoami) /home/ros2_ws/ && sudo chmod a+rw . -R && (rm -r build/ install/ || true) && colcon build --symlink-install --packages-skip-regex zed_*",
"forwardPorts": [5900]
}
2 changes: 1 addition & 1 deletion .devcontainer/nvidia/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@
"source=/usr/lib/x86_64-linux-gnu/dri,target=/usr/lib/x86_64-linux-gnu/dri,type=bind,consistency=cached",
"source=//usr/share/glvnd,target=/usr/share/glvnd,type=bind,consistency=cached"
],
"postCreateCommand": ". .devcontainer/setup.bash && sudo rosdep update --rosdistro=jazzy && sudo rosdep install --from-paths lib src --ignore-src -y --rosdistro=jazzy && sudo chown -R $(whoami) /home/ros2_ws/ && sudo chmod a+rw . -R && (rm -r build/ || true) && colcon build --symlink-install --packages-skip-regex zed_*",
"postCreateCommand": ". .devcontainer/setup.bash && sudo rosdep update --rosdistro=humble && sudo rosdep install --from-paths lib src --ignore-src -y --rosdistro=humble && sudo chown -R $(whoami) /home/ros2_ws/ && sudo chmod a+rw . -R && (rm -r build/ || true) && colcon build --symlink-install --packages-skip-regex zed_*",
"forwardPorts": [8765]
}
15 changes: 10 additions & 5 deletions .devcontainer/setup.bash
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
cd /home/ros2_ws
cd ~/2026RobotCode

mkdir -p lib
cd lib

apt-get update --fix-missing
apt-get upgrade -y

. /opt/ros/jazzy/setup.sh
. /opt/ros/humble/setup.sh


if [ ! -d "rplidar_ros" ] && $ENABLE_LIDAR ; then
Expand All @@ -17,6 +17,11 @@ if [ ! -d "ros_odrive" ] && $ENABLE_ODRIVE ; then
git clone https://github.com/odriverobotics/ros_odrive.git
fi

if [ ! -d zed-ros2-wrapper ] && $HAS_ZED_DEPS; then
git clone https://github.com/stereolabs/zed-ros2-wrapper.git
fi


if $ENABLE_IMU; then
if [ ! -d "imu_ros2" ]; then
git clone https://github.com/analogdevicesinc/imu_ros2.git
Expand Down Expand Up @@ -75,9 +80,9 @@ fi

cd ..

echo '. /opt/ros/jazzy/setup.sh' >> ~/.bashrc
echo '. /opt/ros/humble/setup.sh' >> ~/.bashrc

echo ' if [ -d '/home/ros2_ws/install' ]; then
. /home/ros2_ws/install/setup.bash
echo ' if [ -d '~/2026RobotCode/install' ]; then
. ~/2026RobotCode/install/setup.bash
fi ' >> ~/.bashrc

5 changes: 3 additions & 2 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
},
"label": "colcon: Colcon Build Release"
},

{
"type": "colcon",
"args": [
Expand Down Expand Up @@ -67,13 +68,13 @@
{
"label": "IGVC: Open input keyboard",
"type": "shell",
"command": "source install/setup.bash; gnome-terminal --title 'Teleop twist keyboard' -- sh -c 'ros2 run teleop_twist_keyboard teleop_twist_keyboard --ros-args -r cmd_vel:=/bot_drive_controller/cmd_vel -p use_sim_time:=true -p stamped:=true' -norc",
"command": "source install/setup.bash; gnome-terminal --title 'Teleop twist keyboard' -- sh -c 'ros2 run teleop_twist_keyboard teleop_twist_keyboard --ros-args -r cmd_vel:=/teleop/cmd_vel -p use_sim_time:=true -p stamped:=false' -norc",
"problemMatcher": []
},
{
"label": "IGVC: Open RTAB",
"type": "shell",
"command": "source install/setup.bash; ros2 launch igvc_slam sim_rtabmap.launch.py",
"command": "source install/setup.bash; ros2 launch igvc_slam igvc_slam.launch",
"problemMatcher": []
},
{
Expand Down
4 changes: 2 additions & 2 deletions docs/MACOS_SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ Once inside the container, ROS 2 commands require sourcing the setup file.
### Source ROS 2 (required each new terminal)

```bash
source /opt/ros/jazzy/setup.bash
source /opt/ros/humble/setup.bash
```

### Make it permanent

Run this once to automatically source ROS 2 in every new terminal:

```bash
echo 'source /opt/ros/jazzy/setup.bash' >> ~/.bashrc
echo 'source /opt/ros/humble/setup.bash' >> ~/.bashrc
```

### Verify ROS 2 is working
Expand Down
32 changes: 32 additions & 0 deletions microcontroller_led.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#include <FastLED.h>
#define pinNumber 16
int pinState = 0;

#define NUM_LEDS 60
#define DATA_PIN 3
CRGB leds[NUM_LEDS];

void setup() {
pinMode(pinNumber, INPUT);
FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS);

for (int i = 0; i < NUM_LEDS; i++) {
leds[i] = CRGB::Yellow;
}
FastLED.show();

}

void loop() {
if (pinState != digitalRead(pinNumber)) {
pinState = !pinState;
if (pinState) {
for (int i = 0; i < NUM_LEDS; i++) {
leds[i] = CRGB::Green;
}
} else {
FastLED.clear();
}
FastLED.show();
}
}
Empty file.
80 changes: 80 additions & 0 deletions src/compass_bridge/compass_bridge/compass_bridge.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
from .compass_driver import Compass

import rclpy
from rclpy.node import Node
from std_msgs.msg import Float32
from sensor_msgs.msg import Imu
import sys
import math

class CompassNode(Node):
def __init__(self):
super().__init__('compass_bridge')
self.get_logger().info("compass bridge started")

self.declare_parameter('i2c_bus', 7)
self.declare_parameter('device_address', 0x0E)
self.declare_parameter('config_filepath', '/home/rpirobo3/2026RobotCode/src/igvc_hardware/config/compass_config.yaml')

# Create Compass
self._instance = Compass(
i2c_bus=self.get_parameter('i2c_bus').get_parameter_value().integer_value,
address=self.get_parameter('device_address').get_parameter_value().integer_value,
CONFIG_FILEPATH=self.get_parameter('config_filepath').get_parameter_value().string_value,
logger=self.get_logger()
)

# Create Publisher
self.publisher_ = self.create_publisher(Imu, 'compass', 10)
self.timer = self.create_timer(0.5, self.timer_callback)

def cleanup(self):
try:
self._instance.cleanup()
except Exception as e:
self.get_logger().error(f"Error during cleanup: {e}")

def timer_callback(self):
try:
heading = self._instance.get_heading()
if heading is not None:
heading_yaw = math.radians(heading)
imu_msg = Imu()
imu_msg.header.stamp = self.get_clock().now().to_msg()
imu_msg.header.frame_id = 'imu_link'


half_yaw = heading_yaw * 0.5

imu_msg.orientation.x = 0.0
imu_msg.orientation.y = 0.0
imu_msg.orientation.z = math.sin(half_yaw)
imu_msg.orientation.w = math.cos(half_yaw)

imu_msg.orientation_covariance[0] = -1.0
imu_msg.angular_velocity_covariance[0] = -1.0
imu_msg.linear_acceleration_covariance[0] = -1.0

self.publisher_.publish(imu_msg)

except Exception as e:
self.get_logger().error(f"Error in timer callback: {e}")



def main(args=None):
try:
rclpy.init(args=args)
node = None
node = CompassNode()
rclpy.spin(node)
finally:
if node is not None:
node.cleanup()
node.destroy_node()
if rclpy.ok():
rclpy.shutdown()


if __name__ == '__main__':
main()
Loading