Skip to content

Commit

Permalink
Merge branch 'clean_branches' into improve_centerline
Browse files Browse the repository at this point in the history
  • Loading branch information
Tanish29 authored Jul 18, 2024
2 parents a58762d + 894a150 commit e2d7251
Show file tree
Hide file tree
Showing 118 changed files with 4,236 additions and 126 deletions.
7 changes: 4 additions & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "Autonomous Devcontainer",
"name": "Autonomous Dev",

"dockerComposeFile": "docker-compose.yml",
"service": "autonomous_ros2",
"shutdownAction": "none",

"postCreateCommand": "rosdep install --from-paths src -y --ignore-src && colcon build --symlink-install",
"postCreateCommand": "rosdep install --from-paths src -y --ignore-src && colcon build",

"workspaceFolder": "/ws",
"customizations": {
Expand All @@ -28,7 +28,8 @@
"redhat.vscode-xml",
"twxs.cmake",
"VisualStudioExptTeam.intellicode-api-usage-examples",
"VisualStudioExptTeam.vscodeintellicode"
"VisualStudioExptTeam.vscodeintellicode",
"redhat.vscode-yaml"
]
}
}
Expand Down
10 changes: 8 additions & 2 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ services:
environment:
- DISPLAY
- NVIDIA_VISIBLE_DEVICES=all
- NVIDIA_DRIVER_CAPABILITIES=all
- ROS_DOMAIN_ID=47
volumes:
- ..:/ws
network_mode: host
ipc: host
stdin_open: true
tty: true
runtime: nvidia
# runtime: nvidia
deploy:
resources:
reservations:
Expand All @@ -33,6 +35,8 @@ services:
environment:
- DISPLAY
- NVIDIA_VISIBLE_DEVICES=all
- NVIDIA_DRIVER_CAPABILITIES=all
- ROS_DOMAIN_ID=47
volumes:
#- ..:/ws
#- ../src:/ws/src
Expand All @@ -55,7 +59,9 @@ services:
resources:
reservations:
devices:
- capabilities: [gpu]
- driver: nvidia
device_ids: []
capabilities: [gpu]
privileged: true
devices:
- /dev:/dev
6 changes: 2 additions & 4 deletions .docker_templates/docker-compose.CPU.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,10 @@ services:

autonomous_zed:
image: zed_sdk

privileged: true

build:
context: ..
dockerfile: .devcontainer/zed.Dockerfile
context: .
dockerfile: ./zed.Dockerfile

environment:
- DISPLAY
Expand Down
4 changes: 4 additions & 0 deletions .docker_templates/zed.Jetson.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,8 @@ RUN source /opt/ros/humble/setup.bash && \
RUN echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc && \
echo "source /ws/install/setup.bash" >> ~/.bashrc

RUN . ~/.bashrc

COPY ./.devcontainer/SN31421864.conf /usr/local/zed/settings/SN31421864.conf

CMD ["bash"]
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ kaggle.json
.vscode/settings.json
.gitignore
.vscode/c_cpp_properties.json
**/__pycache__/
**/__pycache__/
*.msg
*.srv
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@
[submodule "Tracks/racetrack-database"]
path = src/planning/path_planning/path_planning/shortest_path/Tracks/racetrack-database
url = https://github.com/TUMFTM/racetrack-database.git
[submodule "ROS2-protobuff-compiler"]
path = ROS2-protobuff-compiler
url = https://github.com/UOA-FSAE/ROS2-protobuff-compiler.git
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,15 @@ For detailed documentation about this project, please visit the **Wiki** tab on
### Ros2

Running commands: `ros2 <command>`

# autonomous

1. build a service (eg. jetson, autonomous_ros2)
```
make build target=jetson
```

2. run a service
```
make up target=jetson
```
1 change: 1 addition & 0 deletions ROS2-protobuff-compiler
44 changes: 44 additions & 0 deletions docker-compose-Darwin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
version: '3.4'

services:
autonomous_ros2:
platform: linux/amd64/v8
image: autonomous

build:
context: .
dockerfile: ./ros2_ws.Dockerfile

environment:
- DISPLAY
- ROS_DOMAIN_ID=47 # Its 47 for obvious reasons

volumes:
- .:/ws

network_mode: host
ipc: host
stdin_open: true
tty: true


jetson:
platform: linux/amd64/v8
image: autonomous

build:
context: .
dockerfile: ./jetson.Dockerfile

environment:
- DISPLAY
- ROS_DOMAIN_ID=47 # Its 47 for obvious reasons

volumes:
- .:/ws

network_mode: host
ipc: host
stdin_open: true
tty: true
# will need to add mroe services
33 changes: 33 additions & 0 deletions docker-compose-Linux.debug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
version: '3.4'

services:
autonomous_ros2:
image: autonomous

build:
context: .
dockerfile: ./Dockerfile

environment:
- DISPLAY
- NVIDIA_VISIBLE_DEVICES=all
- NVIDIA_DRIVER_CAPABILITIES=all

- ROS_DOMAIN_ID=47 # Its 47 for obvious reasons

volumes:
- .:/ws
- /tmp/.X11-unix:/tmp/.X11-unix

network_mode: host
ipc: host
stdin_open: true
tty: true

deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
97 changes: 97 additions & 0 deletions interfaces.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
syntax = "proto3";

message AllStates {
uint16 id = 1;
repeated ackermann_msgs.AckermannDrive states = 2;
}

message AllTrajectories {
uint16 id = 1;
repeated geometry_msgs.PoseArray trajectories = 2;
}
message BoundaryStamped {
std_msgs.Header header = 1;
repeated float32 coords = 2;
}

message CAN {
uint16 id = 1;
bool is_rtr = 2;
repeated uint8 data = 3;
}

message CandidateState {
Ackermann ackermann = 1;
float32 lateralVel = 2;
}

message CandidateStates {
repeated CandidateState candidateState = 1;
}

message CANStamped {
std_msgs.Header header = 1;
CAN can = 2;
}

message Cone {
uint32 id = 0; // ID value of cone (optional, defaults to 0 if not given)

float32 confidence = 1; // The confidence that this is the cone, a percentage value from 0 to 100 (defaults to 0.0)

uint8 colour = 2; // The color of the cone: 0 for Blue, 1 for Orange, 2 for Yellow, and 3 for Other

geometry_msgs.PoseWithCovariance pose = 3; // Position of cone (x, y, z) and rotation

float32 radius = 4; // Size of cone, radius (should default to 0.0)
float32 height = 5; // Size of cone, height (should default to 0.0)

}
// ? can this be renamed to Cones?
message ConeMap {
repeated Cone cones = 1; // List of cones detected and where they are
}
message ConeMapStamped {
std_msgs.Header header = 1;
ConeMap cone_map = 2;
}
message ConeStamped {
std_msgs.Header header = 1;
Cone cone = 2;
}
message HardwareStates {
uint8 ebs_active = 1;
uint8 ts_active = 2;
uint8 in_gear = 3;
uint8 master_switch_on = 4;
uint8 asb_ready = 5;
uint8 brakes_engaged = 6;
}
message HardwareStatesStamped {
std_msgs.Header header = 1;
HardwareStates hardware_states = 2;
}
message MissionStates {
uint8 mission_selected = 1;
uint8 mission_finished = 2;
}
message MissionStatesStamped {
std_msgs.Header header = 1;
MissionStates mission_states = 2;
}

message OccupancyGrid{
std_msgs.Header header = 1;
repeated Rptuint8 occupancyGrid = 2;
float32 resolution = 3;
}

service Services {
rpc CANSendReq (CANSendReqRequest) returns (CANSendReqResponce);
}
message CANSendReqRequest {
CAN can = 1;
}
message CANSendReqResponce {
bool sent =1;
}
1 change: 1 addition & 0 deletions interfaces_clean.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python3 ROS2-protobuff-compiler/protobuf2rosmsg.py -m src/moa/moa_msgs/msg -s src/moa/moa_msgs/srv -c
1 change: 1 addition & 0 deletions interfaces_clean.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python %~dp0ROS2-protobuff-compiler\protobuf2rosmsg.py -m %~dp0src\moa\moa_msgs\msg -s %~dp0src\moa\moa_msgs\srv -c
1 change: 1 addition & 0 deletions interfaces_run.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python3 ROS2-protobuff-compiler/protobuf2rosmsg.py -f interfaces.proto -m src/moa/moa_msgs/msg -s src/moa/moa_msgs/srv -c
1 change: 1 addition & 0 deletions interfaces_run.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python %~dp0ROS2-protobuff-compiler\protobuf2rosmsg.py -f %~dp0interfaces.proto -m %~dp0src\moa\moa_msgs\msg -s %~dp0src\moa\moa_msgs\srv -c
23 changes: 23 additions & 0 deletions jetson.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM osrf/ros:humble-desktop
LABEL Name=autonomous Version=0.0.1

SHELL [ "/bin/bash", "-c" ]

WORKDIR /ws
COPY . .

RUN source /opt/ros/humble/setup.bash && \
rosdep update && \
colcon build

RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
cmake \
git \
python3-pip

ENTRYPOINT ["/ros_entrypoint.sh"]

CMD [ "ros2", "launch", "launch/demo_nodes_launch.py" ]

Binary file added launch/__pycache__/demo_nodes_launch.cpython-310.pyc
Binary file not shown.
20 changes: 20 additions & 0 deletions launch/demo_nodes_launch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from launch import LaunchDescription
from launch_ros.actions import Node

def generate_launch_description():
ld = LaunchDescription()

talker_node = Node(
package="demo_nodes_cpp",
executable="talker",
)

listener_node = Node(
package="demo_nodes_py",
executable="listener"
)

ld.add_action(talker_node)
ld.add_action(listener_node)

return ld
22 changes: 22 additions & 0 deletions ros2_ws.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM stereolabs/zed:3.8-devel-cuda11.7-ubuntu22.04
FROM osrf/ros:humble-desktop

LABEL Name=autonomous Version=0.0.1

SHELL [ "/bin/bash", "-c" ]

WORKDIR /ws
COPY . .

RUN apt-get update && apt-get install -y \
python3-pip \
ros-humble-foxglove-bridge

RUN source /opt/ros/humble/setup.bash && \
rosdep update

RUN echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc && \
echo "source /ws/install/setup.bash" >> ~/.bashrc

ENTRYPOINT ["/ros_entrypoint.sh"]
CMD [ "bash" ]
Loading

0 comments on commit e2d7251

Please sign in to comment.