Skip to content

Commit

Permalink
Added docker-compose and fixed typo initialised vehicle location map
Browse files Browse the repository at this point in the history
  • Loading branch information
mhl787156 committed May 30, 2022
1 parent 9a575e4 commit 7e6a567
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Syncrhonous Position Trajectory Controller
# Synchronous Position Trajectory Controller

This project provides a synchonous simple position trajectory controller for ROS2, MAVROS and (currently) PX4 for multi-vehicle flight

Expand Down
58 changes: 58 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@

version: '3'

services:
simhost: # Must be called simhost
image: uobflightlabstarling/starling-sim-iris-px4-flightarena:latest
command: [ "ros2", "launch", "launch/system.launch.xml" , sim_only:=true]
ports:
- "8080:8080"

# ----------
# Spawn Vehicle 1
gazebo_spawn_1:
image: uobflightlabstarling/starling-sim-iris:latest
command: [ "./spawn_iris.sh" ]
environment:
- "PX4_SIM_HOST=localhost"
- "PX4_INSTANCE=0"
- "IGNORE_FAILURE=true"
depends_on:
- simhost
pid: "host" # Share Process ID Namespace

sitl:
image: uobflightlabstarling/starling-sim-px4-sitl:latest
environment:
- "PX4_SIM_HOST=simhost"
- "PX4_OFFBOARD_HOST=mavros"
- "PX4_INSTANCE=0"
depends_on:
- gazebo_spawn_1
ports:
- "18570:18570/udp"

mavros:
image: uobflightlabstarling/starling-mavros:latest
command: ros2 launch launch/mavros_bridge.launch.xml
environment:
- "MAVROS_TGT_SYSTEM=1"
- "MAVROS_FCU_IP=0.0.0.0"
- "MAVROS_GCS_URL=tcp-l://0.0.0.0:5760"
depends_on:
- sitl
ports:
- "5760:5760"

rosbridge-suite:
image: uobflightlabstarling/rosbridge-suite:latest
ports:
- "9090:9090"

allocator:
image: uobflightlabstarling/starling-allocator:latest

starling-ui-dashly:
image: mickeyli789/starling-ui-dashly:latest
ports:
- "3001:3000"
4 changes: 4 additions & 0 deletions kubernetes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,8 @@ spec:
imagePullPolicy: Always
ports:
- containerPort: 3000
- name: rosbridge-suite
image: uobflightlabstarling/rosbridge-suite:latest
imagePullPolicy: Always
ports:
- containerPort: 9090
3 changes: 3 additions & 0 deletions position_trajectory_controller/src/trajectory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ void TrajectoryHandler::reset(){
this->next_delay = std::chrono::duration<double>(0.0);
this->sync_cumulative_delay = std::chrono::duration<double>(0.0);
this->vehicle_delays.clear();
Duration delay = Duration::from_seconds(0.0);
auto const result = this->vehicle_delays.insert(std::make_pair(this->vehicle_id, delay));
if (not result.second) { result.first->second = delay; }
this->current_task_idx = 0;
this->sync_wait_until = nullptr;

Expand Down

0 comments on commit 7e6a567

Please sign in to comment.