Skip to content

Commit 16b80c8

Browse files
author
Bernd Gassmann
committed
Add LoadMap.srv GetAvailableMaps.srv
made GetBlueprints.srv to return the complete blueprint information use CarlaActorBlueprint type in SpawnObject
1 parent be249fe commit 16b80c8

11 files changed

Lines changed: 166 additions & 19 deletions

CMakeLists.txt

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,26 @@ if (NOT ROS_VERSION)
99
return()
1010
endif()
1111

12-
set(SERVICE_FILES SpawnObject.srv DestroyObject.srv GetBlueprints.srv)
12+
set(SERVICE_FILES
13+
DestroyObject.srv
14+
GetAvailableMaps.srv
15+
GetBlueprints.srv
16+
LoadMap.srv
17+
SpawnObject.srv
18+
)
1319

1420
set(MSG_FILES
21+
CarlaActorBlueprint.msg
22+
CarlaActorInfo.msg
23+
CarlaActorList.msg
1524
CarlaBoundingBox.msg
25+
CarlaCollisionEvent.msg
26+
CarlaControl.msg
1627
CarlaVehicleControl.msg
17-
CarlaVehicleInfoWheel.msg
1828
CarlaVehicleInfo.msg
29+
CarlaVehicleInfoWheel.msg
1930
CarlaVehicleStatus.msg
20-
CarlaCollisionEvent.msg
2131
CarlaLaneInvasionEvent.msg
22-
CarlaWorldInfo.msg
23-
CarlaActorInfo.msg
24-
CarlaActorList.msg
25-
CarlaControl.msg
2632
CarlaStatus.msg
2733
CarlaTrafficLightInfo.msg
2834
CarlaTrafficLightInfoList.msg
@@ -33,7 +39,9 @@ set(MSG_FILES
3339
CarlaV2XCustomDataList.msg
3440
CarlaV2XCustomMessage.msg
3541
CarlaWalkerControl.msg
36-
CarlaWeatherParameters.msg)
42+
CarlaWeatherParameters.msg
43+
CarlaWorldInfo.msg
44+
)
3745

3846
if(${ROS_VERSION} EQUAL 1)
3947
cmake_minimum_required(VERSION 2.8.3)

msg/CarlaActorBlueprint.idl

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// generated from rosidl_adapter/resource/msg.idl.em
2+
// with input from carla_msgs/msg/CarlaActorBlueprint.msg
3+
// generated code does not contain a copyright notice
4+
#pragma once
5+
6+
#include "diagnostic_msgs/msg/KeyValue.idl"
7+
8+
module carla_msgs {
9+
module msg {
10+
@verbatim (language="comment", text=
11+
"Copyright (c) 2024 Intel Corporation." "\n"
12+
"" "\n"
13+
"This work is licensed under the terms of the MIT license." "\n"
14+
"For a copy, see <https://opensource.org/licenses/MIT>.")
15+
struct CarlaActorBlueprint {
16+
string id;
17+
18+
sequence<string> tags;
19+
20+
sequence<diagnostic_msgs::msg::KeyValue> attributes;
21+
};
22+
};
23+
};

msg/CarlaActorBlueprint.msg

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#
2+
# Copyright (c) 2024 Intel Corporation.
3+
#
4+
# This work is licensed under the terms of the MIT license.
5+
# For a copy, see <https://opensource.org/licenses/MIT>.
6+
#
7+
8+
string id
9+
string[] tags
10+
diagnostic_msgs/KeyValue[] attributes

srv/GetAvailableMaps.idl

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// generated from rosidl_adapter/resource/srv.idl.em
2+
// with input from carla_msgs/srv/GetAvailableMaps.srv
3+
// generated code does not contain a copyright notice
4+
#pragma once
5+
6+
7+
module carla_msgs {
8+
module srv {
9+
@verbatim (language="comment", text=
10+
"Copyright (c) 2024 Intel Corporation." "\n"
11+
"" "\n"
12+
"This work is licensed under the terms of the MIT license." "\n"
13+
"For a copy, see <https://opensource.org/licenses/MIT>.")
14+
struct GetAvailableMaps_Request {
15+
uint8 structure_needs_at_least_one_member;
16+
};
17+
struct GetAvailableMaps_Response {
18+
sequence<string> maps;
19+
};
20+
};
21+
};

srv/GetAvailableMaps.srv

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#
2+
# Copyright (c) 2024 Intel Corporation.
3+
#
4+
# This work is licensed under the terms of the MIT license.
5+
# For a copy, see <https://opensource.org/licenses/MIT>.
6+
#
7+
---
8+
string[] maps

srv/GetBlueprints.idl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
#pragma once
55

66

7+
#include "carla_msgs/msg/CarlaActorBlueprint.idl"
8+
79
module carla_msgs {
810
module srv {
911
@verbatim (language="comment", text=
@@ -15,7 +17,7 @@ module carla_msgs {
1517
string filter;
1618
};
1719
struct GetBlueprints_Response {
18-
sequence<string> blueprints;
20+
sequence<carla_msgs::msg::CarlaActorBlueprint> blueprints;
1921
};
2022
};
2123
};

srv/GetBlueprints.srv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
#
77
string filter
88
---
9-
string[] blueprints
9+
carla_msgs/CarlaActorBlueprint[] blueprints

srv/LoadMap.idl

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// generated from rosidl_adapter/resource/srv.idl.em
2+
// with input from carla_msgs/srv/LoadMap.srv
3+
// generated code does not contain a copyright notice
4+
#pragma once
5+
6+
module carla_msgs {
7+
module srv {
8+
module LoadMap_Request_Constants {
9+
@verbatim (language="comment", text=
10+
"These are the flags for the map layers to be loaded")
11+
const uint16 MAPLAYERFLAG_NONE = 0;
12+
const uint16 MAPLAYERFLAG_BUILDINGS = 1;
13+
const uint16 MAPLAYERFLAG_DECALS = 2;
14+
const uint16 MAPLAYERFLAG_FOLIAGE = 4;
15+
const uint16 MAPLAYERFLAG_GROUND = 8;
16+
const uint16 MAPLAYERFLAG_PARKEDVEHICLES = 16;
17+
const uint16 MAPLAYERFLAG_PARTICLES = 32;
18+
const uint16 MAPLAYERFLAG_PROPS = 64;
19+
const uint16 MAPLAYERFLAG_STREETLIGHTS = 128;
20+
const uint16 MAPLAYERFLAG_WALLS = 256;
21+
const uint16 MAPLAYERFLAG_ALL = 65535;
22+
};
23+
@verbatim (language="comment", text=
24+
"Copyright (c) 2020 Intel Corporation." "\n"
25+
"" "\n"
26+
"This work is licensed under the terms of the MIT license." "\n"
27+
"For a copy, see <https://opensource.org/licenses/MIT>.")
28+
struct LoadMap_Request {
29+
string mapname;
30+
31+
@verbatim (language="comment", text=
32+
"If the map was already loaded, per default nothing is done (resulting in a success=false response). By setting force_reload to \c True this behavior can be changed.")
33+
@default (value=FALSE)
34+
boolean force_reload;
35+
36+
@verbatim (language="comment", text=
37+
"Should the episode settings be reset to the default")
38+
@default (value=TRUE)
39+
boolean reset_episode_settings;
40+
41+
@verbatim (language="comment", text=
42+
"The map layers to be loaded, default is MAPLAYERFLAG_ALL")
43+
@default (value=65535)
44+
uint16 map_layers;
45+
};
46+
struct LoadMap_Response {
47+
boolean success;
48+
};
49+
};
50+
};

srv/LoadMap.srv

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#
2+
# Copyright (c) 2020 Intel Corporation.
3+
#
4+
# This work is licensed under the terms of the MIT license.
5+
# For a copy, see <https://opensource.org/licenses/MIT>.
6+
#
7+
8+
# These are the flags for the map layers to be loaded
9+
uint16 MAPLAYERFLAG_NONE = 0
10+
uint16 MAPLAYERFLAG_BUILDINGS = 1
11+
uint16 MAPLAYERFLAG_DECALS = 2
12+
uint16 MAPLAYERFLAG_FOLIAGE = 4
13+
uint16 MAPLAYERFLAG_GROUND = 8
14+
uint16 MAPLAYERFLAG_PARKEDVEHICLES = 16
15+
uint16 MAPLAYERFLAG_PARTICLES = 32
16+
uint16 MAPLAYERFLAG_PROPS = 64
17+
uint16 MAPLAYERFLAG_STREETLIGHTS = 128
18+
uint16 MAPLAYERFLAG_WALLS = 256
19+
uint16 MAPLAYERFLAG_ALL = 65535
20+
21+
string mapname
22+
# If the map was already loaded, per default nothing is done (resulting in a success=false response). By setting force_reload to \c True this behavior can be changed.
23+
bool force_reload False
24+
# Should the episode settings be reset to the default
25+
bool reset_episode_settings True
26+
# The map layers to be loaded, default is MAPLAYERFLAG_ALL
27+
uint16 map_layers 65535
28+
29+
---
30+
bool success

srv/SpawnObject.idl

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
// generated code does not contain a copyright notice
44
#pragma once
55

6-
#include "diagnostic_msgs/msg/KeyValue.idl"
6+
7+
#include "carla_msgs/msg/CarlaActorBlueprint.idl"
78
#include "geometry_msgs/msg/Pose.idl"
89

910
module carla_msgs {
@@ -14,11 +15,7 @@ module carla_msgs {
1415
"This work is licensed under the terms of the MIT license." "\n"
1516
"For a copy, see <https://opensource.org/licenses/MIT>.")
1617
struct SpawnObject_Request {
17-
string type;
18-
19-
string id;
20-
21-
sequence<diagnostic_msgs::msg::KeyValue> attributes;
18+
carla_msgs::msg::CarlaActorBlueprint blueprint;
2219

2320
geometry_msgs::msg::Pose transform;
2421

0 commit comments

Comments
 (0)