Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
!tod_omnet_network
!tod_simulator
!.gitignore
!zero_delay_network
!zero_delay_network/**
!zero-delay-network
!zero-delay-network/**
!images
!images/**
!.env
10 changes: 5 additions & 5 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[submodule "tod_simulator"]
[submodule "tod-carla"]
path = tod-carla
url = https://github.com/Jaivra/tod_simulator
branch = dev
[submodule "tod_omnet_network"]
url = git@github.com:busolind/tod-carla.git

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

branch = main
[submodule "tod-omnet"]
path = tod-omnet
url = https://github.com/Jaivra/tod_omnet_network
url = git@github.com:busolind/tod-omnet.git

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you Valerio,
we are going to revise the repos, as soon as the the others are ok, we fix these!

branch = main
14 changes: 11 additions & 3 deletions carla-sim-supervisor/sim_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@

class CarlaHandlerRPC:

def __init__(self, carla_sh_path) -> None:
def __init__(self, carla_sh_path, offscreen : bool = False) -> None:
self._carla_simulator_proc = None
self._carla_launch_script = [carla_sh_path, '-RenderOffScreen', '>/dev/null', '2>/dev/null']
if offscreen:
self._carla_launch_script = [carla_sh_path, '-RenderOffScreen', '>/dev/null', '2>/dev/null']
else:
self._carla_launch_script = [carla_sh_path, '>/dev/null', '2>/dev/null']

def _carla_service_is_active(self):
return self._carla_simulator_proc is not None and self._carla_simulator_proc.poll() is None
Expand Down Expand Up @@ -78,8 +81,13 @@ def close_simulator(self):

if __name__ == '__main__':
carla_sh_path = sys.argv[1]
offscreen = False
try:
offscreen = bool(sys.argv[2])
except IndexError:
...
print(carla_sh_path)
s = zerorpc.Server(CarlaHandlerRPC(carla_sh_path))
s = zerorpc.Server(CarlaHandlerRPC(carla_sh_path, offscreen))
s.bind('tcp://0.0.0.0:4242')
print('RPC server running')
s.run()
10 changes: 6 additions & 4 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ version: '3.9'

services:
tod-carla:
#depends_on:
# - carla_simulator
container_name: tod-carla
depends_on:
- carla-simulator
build: tod-carla
volumes:
- type: bind
Expand All @@ -26,6 +27,7 @@ services:
carla-simulator:
#image: carlasim/carla:0.9.13
build: carla-sim-supervisor
container_name: carla-simulator

privileged: true
deploy:
Expand Down Expand Up @@ -61,8 +63,8 @@ services:


zero-delay-network:
#depends_on:
# - tod_simulator
depends_on:
- tod-carla
build:
context: zero-delay-network
args:
Expand Down
2 changes: 1 addition & 1 deletion tod-carla
Submodule tod-carla updated 37 files
+1 −1 README.md
+5 −3 configuration/actor/simple_vehicle.yaml
+15 −0 configuration/actor/simple_vehicle_bg_0.yaml
+15 −0 configuration/actor/simple_vehicle_bg_1.yaml
+15 −0 configuration/actor/simple_vehicle_bg_2.yaml
+3 −0 configuration/agent/simple_agent_bg_0.yaml
+3 −0 configuration/agent/simple_agent_bg_1.yaml
+3 −0 configuration/agent/simple_agent_bg_2.yaml
+20 −0 configuration/route/city_trip_world_4_new.yaml
+15 −0 configuration/route/city_world_4_bg_0.yaml
+14 −0 configuration/route/city_world_4_bg_1.yaml
+15 −0 configuration/route/city_world_4_bg_2.yaml
+28 −0 configuration/route/hwy_world_4_moving_obstacle.yaml
+29 −0 configuration/route/hwy_world_4_sudden_obstacle.yaml
+1 −1 configuration/route/long_distance_world_4.yaml
+23 −0 configuration/route/original_city_trip_world_4.yaml
+18 −0 configuration/route/original_city_trip_world_4_bg_0.yaml
+18 −0 configuration/route/original_city_trip_world_4_bg_1.yaml
+18 −0 configuration/route/original_city_trip_world_4_bg_2.yaml
+11 −0 configuration/route/straight_city_world_4.yaml
+35 −0 configuration/route/straight_city_world_4_obstacles.yaml
+29 −0 configuration/route/straight_city_world_4_sudden_obstacle.yaml
+28 −0 configuration/route/straight_hwy_world_4_obstacles.yaml
+48 −0 configuration/simulator/local.yaml
+6 −2 lib/agents/navigation/basic_agent.py
+5 −1 lib/agents/navigation/behavior_agent.py
+15 −3 lib/agents/navigation/behavior_types.py
+2 −1 lib/agents/navigation/local_planner.py
+1 −1 requirements.txt
+95 −18 src/EnvironmentHandler.py
+12 −1 src/actor/carla_actor/TeleCarlaActor.py
+5 −5 src/actor/carla_actor/TeleCarlaSensor.py
+1 −1 src/actor/external_active_actor/TeleOperator.py
+1 −1 src/actor/external_passive_actor/InfoSimulationActor.py
+21 −0 src/actor/external_passive_actor/MovingBackgroundVehicle.py
+4 −1 src/carla_omnet/CarlaOmnetSimulator.py
+14 −7 src/main.py
Empty file removed zero-delay-network/.gitignore
Empty file.
8 changes: 4 additions & 4 deletions zero-delay-network/API/init.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{
"message_type": "INIT",
"timestamp": 0,
"run_id": "id_current_simulation",
"run_id": "Hwy-Obstacle-old-detection-zero-delay",
"moving_actors": [
{
"actor_id": "car_id",
"actor_type": "car",
"actor_configuration": {
"configuration_id": "simple_vehicle",
"route": "simple_curve_world_1",
"route": "straight_hwy_world_4_obstacles",
"agent_configuration": "simple_agent",
"agent_id": "agent_id"
}
}
],
"carla_configuration": {
"seed": 11120,
"sim_time_limit": 350,
"sim_time_limit": 30,
"carla_timestep": 0.01
},
"user_defined": {
"carla_world_configuration": "world_1"
"carla_world_configuration": "world_4"
}
}
2 changes: 1 addition & 1 deletion zero-delay-network/API/simulation_step.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"message_type": "SIMULATION_STEP",
"carla_timestep": 0.05,
"carla_timestep": 0.01,
"timestamp": 0
}
8 changes: 8 additions & 0 deletions zero-delay-network/API_city/actor_status_update.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"message_type": "GENERIC_MESSAGE",
"timestamp": 0,
"user_defined": {
"user_message_type": "ACTOR_STATUS_UPDATE",
"actor_id": "car_id"
}
}
9 changes: 9 additions & 0 deletions zero-delay-network/API_city/apply_instruction.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"message_type": "GENERIC_MESSAGE",
"timestamp": 0,
"user_defined": {
"user_message_type": "APPLY_INSTRUCTION",
"actor_id": "car_id",
"instruction_id": "instruction_id"
}
}
10 changes: 10 additions & 0 deletions zero-delay-network/API_city/compute_instruction.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"message_type": "GENERIC_MESSAGE",
"timestamp": 0,
"user_defined": {
"user_message_type": "COMPUTE_INSTRUCTION",
"actor_id": "car_id",
"agent_id": "agent_id",
"status_id": "status_id"
}
}
25 changes: 25 additions & 0 deletions zero-delay-network/API_city/init.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"message_type": "INIT",
"timestamp": 0,
"run_id": "Straight-Obstacle-zero-delay",
"moving_actors": [
{
"actor_id": "car_id",
"actor_type": "car",
"actor_configuration": {
"configuration_id": "simple_vehicle",
"route": "straight_city_world_4_obstacles",
"agent_configuration": "simple_agent",
"agent_id": "agent_id"
}
}
],
"carla_configuration": {
"seed": 11120,
"sim_time_limit": 19,
"carla_timestep": 0.01
},
"user_defined": {
"carla_world_configuration": "world_4"
}
}
5 changes: 5 additions & 0 deletions zero-delay-network/API_city/simulation_step.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"message_type": "SIMULATION_STEP",
"carla_timestep": 0.01,
"timestamp": 0
}
8 changes: 8 additions & 0 deletions zero-delay-network/API_city_sudden/actor_status_update.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"message_type": "GENERIC_MESSAGE",
"timestamp": 0,
"user_defined": {
"user_message_type": "ACTOR_STATUS_UPDATE",
"actor_id": "car"
}
}
9 changes: 9 additions & 0 deletions zero-delay-network/API_city_sudden/apply_instruction.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"message_type": "GENERIC_MESSAGE",
"timestamp": 0,
"user_defined": {
"user_message_type": "APPLY_INSTRUCTION",
"actor_id": "car",
"instruction_id": "instruction_id"
}
}
10 changes: 10 additions & 0 deletions zero-delay-network/API_city_sudden/compute_instruction.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"message_type": "GENERIC_MESSAGE",
"timestamp": 0,
"user_defined": {
"user_message_type": "COMPUTE_INSTRUCTION",
"actor_id": "car",
"agent_id": "agent_id",
"status_id": "status_id"
}
}
25 changes: 25 additions & 0 deletions zero-delay-network/API_city_sudden/init.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"message_type": "INIT",
"timestamp": 0,
"run_id": "City-Sudden-Obstacle-zero-delay",
"moving_actors": [
{
"actor_id": "car",
"actor_type": "car",
"actor_configuration": {
"configuration_id": "simple_vehicle",
"route": "straight_city_world_4_sudden_obstacle",
"agent_configuration": "simple_agent",
"agent_id": "agent_id"
}
}
],
"carla_configuration": {
"seed": 11120,
"sim_time_limit": 19,
"carla_timestep": 0.01
},
"user_defined": {
"carla_world_configuration": "world_4"
}
}
5 changes: 5 additions & 0 deletions zero-delay-network/API_city_sudden/simulation_step.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"message_type": "SIMULATION_STEP",
"carla_timestep": 0.01,
"timestamp": 0
}
8 changes: 8 additions & 0 deletions zero-delay-network/API_hwy/actor_status_update.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"message_type": "GENERIC_MESSAGE",
"timestamp": 0,
"user_defined": {
"user_message_type": "ACTOR_STATUS_UPDATE",
"actor_id": "car_id"
}
}
9 changes: 9 additions & 0 deletions zero-delay-network/API_hwy/apply_instruction.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"message_type": "GENERIC_MESSAGE",
"timestamp": 0,
"user_defined": {
"user_message_type": "APPLY_INSTRUCTION",
"actor_id": "car_id",
"instruction_id": "instruction_id"
}
}
10 changes: 10 additions & 0 deletions zero-delay-network/API_hwy/compute_instruction.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"message_type": "GENERIC_MESSAGE",
"timestamp": 0,
"user_defined": {
"user_message_type": "COMPUTE_INSTRUCTION",
"actor_id": "car_id",
"agent_id": "agent_id",
"status_id": "status_id"
}
}
25 changes: 25 additions & 0 deletions zero-delay-network/API_hwy/init.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"message_type": "INIT",
"timestamp": 0,
"run_id": "Hwy-Obstacle-old-detection-zero-delay",
"moving_actors": [
{
"actor_id": "car",
"actor_type": "car",
"actor_configuration": {
"configuration_id": "simple_vehicle",
"route": "straight_hwy_world_4_obstacles",
"agent_configuration": "simple_agent",
"agent_id": "agent_id"
}
}
],
"carla_configuration": {
"seed": 11120,
"sim_time_limit": 30,
"carla_timestep": 0.01
},
"user_defined": {
"carla_world_configuration": "world_4"
}
}
5 changes: 5 additions & 0 deletions zero-delay-network/API_hwy/simulation_step.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"message_type": "SIMULATION_STEP",
"carla_timestep": 0.01,
"timestamp": 0
}
8 changes: 8 additions & 0 deletions zero-delay-network/API_hwy_moving/actor_status_update.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"message_type": "GENERIC_MESSAGE",
"timestamp": 0,
"user_defined": {
"user_message_type": "ACTOR_STATUS_UPDATE",
"actor_id": "car_id"
}
}
9 changes: 9 additions & 0 deletions zero-delay-network/API_hwy_moving/apply_instruction.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"message_type": "GENERIC_MESSAGE",
"timestamp": 0,
"user_defined": {
"user_message_type": "APPLY_INSTRUCTION",
"actor_id": "car_id",
"instruction_id": "instruction_id"
}
}
10 changes: 10 additions & 0 deletions zero-delay-network/API_hwy_moving/compute_instruction.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"message_type": "GENERIC_MESSAGE",
"timestamp": 0,
"user_defined": {
"user_message_type": "COMPUTE_INSTRUCTION",
"actor_id": "car_id",
"agent_id": "agent_id",
"status_id": "status_id"
}
}
25 changes: 25 additions & 0 deletions zero-delay-network/API_hwy_moving/init.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"message_type": "INIT",
"timestamp": 0,
"run_id": "Hwy-Moving-Obstacle-old-detection-zero-delay",
"moving_actors": [
{
"actor_id": "car_id",
"actor_type": "car",
"actor_configuration": {
"configuration_id": "simple_vehicle",
"route": "hwy_world_4_moving_obstacle",
"agent_configuration": "simple_agent",
"agent_id": "agent_id"
}
}
],
"carla_configuration": {
"seed": 11120,
"sim_time_limit": 38,
"carla_timestep": 0.01
},
"user_defined": {
"carla_world_configuration": "world_4"
}
}
5 changes: 5 additions & 0 deletions zero-delay-network/API_hwy_moving/simulation_step.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"message_type": "SIMULATION_STEP",
"carla_timestep": 0.01,
"timestamp": 0
}
8 changes: 8 additions & 0 deletions zero-delay-network/API_hwy_sudden/actor_status_update.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"message_type": "GENERIC_MESSAGE",
"timestamp": 0,
"user_defined": {
"user_message_type": "ACTOR_STATUS_UPDATE",
"actor_id": "car"
}
}
Loading