Skip to content

Commit af05e51

Browse files
authored
Merge branch 'dev' into overhaul-agent-parameters
2 parents bb1c98f + d5d3cf9 commit af05e51

File tree

33 files changed

+948
-383
lines changed

33 files changed

+948
-383
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,12 @@
88
* Added functions to get actor' bones and components names
99
* Added functions to get actor' sockets transforms
1010
* make PythonAPI Windows: Fixed incompatibility issue with Anaconda due `py` command.
11+
* Added function to get actor' sockets names
1112
* Fixed bug in python agents when vehicle list was empty causing a check on all vehicles (BasicAgent.py) and detected pedestrians as vehicles if no pedestrains are present (BehaviourAgent.py)
13+
* Extended debug drawing functions to allow drawing primitives on HUD layer
1214
* Added possibility to change gravity variable in imui sensor for the accelerometer
15+
* Fixed ROS2 native extension build error when ROS2 is installed in the system.
16+
* ROS2Native: Force fast-dds dependencies download to avoid build crash when boost_asio and tinyxml2 are not installed in Linux.
1317
* Unified the settings of the Python agents to use a dictionary structure for most of their parameters which further allows more dynamic changes.
1418

1519
## CARLA 0.9.15
@@ -39,6 +43,8 @@
3943
* Fixed bug causing the `FPixelReader::SavePixelsToDisk(PixelData, FilePath)` function to crash due to pixel array not set correctly.
4044
* Fixed segfaults in Python API due to incorrect GIL locking under Python 3.10.
4145
* Fixed the import script, where could use any other TilesInfo.txt if the destination folder has many
46+
* Fixed PythonAPI not installing on Debian due to deprecated function of distro in setup.py. Less ambiguous error for other posix platforms.
47+
4248

4349
## CARLA 0.9.14
4450

Co-Simulation/Sumo/sumo_integration/sumo_simulation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ def _get_sumo_net(cfg_file):
301301
net_file = os.path.join(os.path.dirname(cfg_file), tag.get('value'))
302302
logging.debug('Reading net file: %s', net_file)
303303

304-
sumo_net = traci.sumolib.net.readNet(net_file)
304+
sumo_net = sumolib.net.readNet(net_file)
305305
return sumo_net
306306

307307
class SumoSimulation(object):

Docs/python_api.md

Lines changed: 273 additions & 241 deletions
Large diffs are not rendered by default.

LibCarla/source/carla/client/Actor.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ namespace client {
6464
return GetEpisode().Lock()->GetActorSocketRelativeTransforms(*this);
6565
}
6666

67+
std::vector<std::string> Actor::GetSocketNames() const {
68+
return GetEpisode().Lock()->GetActorSocketNames(*this);
69+
}
70+
6771
void Actor::SetLocation(const geom::Location &location) {
6872
GetEpisode().Lock()->SetActorLocation(*this, location);
6973
}

LibCarla/source/carla/client/Actor.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ namespace client {
7676

7777
std::vector<geom::Transform> GetSocketRelativeTransforms() const;
7878

79+
std::vector<std::string> GetSocketNames() const;
80+
7981
/// Teleport the actor to @a location.
8082
void SetLocation(const geom::Location &location);
8183

LibCarla/source/carla/client/DebugHelper.cpp

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,16 @@ namespace client {
3535
DrawShape(_episode, point, color, life_time, persistent_lines);
3636
}
3737

38+
void DebugHelper::DrawHUDPoint(
39+
const geom::Location &location,
40+
float size,
41+
sensor::data::Color color,
42+
float life_time,
43+
bool persistent_lines) {
44+
Shape::HUDPoint point{location, size};
45+
DrawShape(_episode, point, color, life_time, persistent_lines);
46+
}
47+
3848
void DebugHelper::DrawLine(
3949
const geom::Location &begin,
4050
const geom::Location &end,
@@ -46,6 +56,17 @@ namespace client {
4656
DrawShape(_episode, line, color, life_time, persistent_lines);
4757
}
4858

59+
void DebugHelper::DrawHUDLine(
60+
const geom::Location &begin,
61+
const geom::Location &end,
62+
float thickness,
63+
Color color,
64+
float life_time,
65+
bool persistent_lines) {
66+
Shape::HUDLine line{begin, end, thickness};
67+
DrawShape(_episode, line, color, life_time, persistent_lines);
68+
}
69+
4970
void DebugHelper::DrawArrow(
5071
const geom::Location &begin,
5172
const geom::Location &end,
@@ -59,6 +80,19 @@ namespace client {
5980
DrawShape(_episode, arrow, color, life_time, persistent_lines);
6081
}
6182

83+
void DebugHelper::DrawHUDArrow(
84+
const geom::Location &begin,
85+
const geom::Location &end,
86+
float thickness,
87+
float arrow_size,
88+
sensor::data::Color color,
89+
float life_time,
90+
bool persistent_lines) {
91+
Shape::HUDLine line{begin, end, thickness};
92+
Shape::HUDArrow arrow{line, arrow_size};
93+
DrawShape(_episode, arrow, color, life_time, persistent_lines);
94+
}
95+
6296
void DebugHelper::DrawBox(
6397
const geom::BoundingBox &box,
6498
const geom::Rotation &rotation,
@@ -70,6 +104,17 @@ namespace client {
70104
DrawShape(_episode, the_box, color, life_time, persistent_lines);
71105
}
72106

107+
void DebugHelper::DrawHUDBox(
108+
const geom::BoundingBox &box,
109+
const geom::Rotation &rotation,
110+
float thickness,
111+
sensor::data::Color color,
112+
float life_time,
113+
bool persistent_lines) {
114+
Shape::HUDBox the_box{box, rotation, thickness};
115+
DrawShape(_episode, the_box, color, life_time, persistent_lines);
116+
}
117+
73118
void DebugHelper::DrawString(
74119
const geom::Location &location,
75120
const std::string &text,

LibCarla/source/carla/client/DebugHelper.h

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ namespace client {
3030
float life_time = -1.0f,
3131
bool persistent_lines = true);
3232

33+
void DrawHUDPoint(
34+
const geom::Location &location,
35+
float size = 0.1f,
36+
Color color = Color{255u, 0u, 0u},
37+
float life_time = -1.0f,
38+
bool persistent_lines = true);
39+
3340
void DrawLine(
3441
const geom::Location &begin,
3542
const geom::Location &end,
@@ -38,6 +45,14 @@ namespace client {
3845
float life_time = -1.0f,
3946
bool persistent_lines = true);
4047

48+
void DrawHUDLine(
49+
const geom::Location &begin,
50+
const geom::Location &end,
51+
float thickness = 1.0f,
52+
Color color = Color{225u, 0u, 0u},
53+
float life_time = -1.0f,
54+
bool presistent_lines = true);
55+
4156
void DrawArrow(
4257
const geom::Location &begin,
4358
const geom::Location &end,
@@ -47,6 +62,15 @@ namespace client {
4762
float life_time = -1.0f,
4863
bool persistent_lines = true);
4964

65+
void DrawHUDArrow(
66+
const geom::Location &begin,
67+
const geom::Location &end,
68+
float thickness = 0.1f,
69+
float arrow_size = 0.1f,
70+
Color color = Color{255u, 0u, 0u},
71+
float life_time = -1.0f,
72+
bool persistent_lines = true);
73+
5074
void DrawBox(
5175
const geom::BoundingBox &box,
5276
const geom::Rotation &rotation,
@@ -55,6 +79,14 @@ namespace client {
5579
float life_time = -1.0f,
5680
bool persistent_lines = true);
5781

82+
void DrawHUDBox(
83+
const geom::BoundingBox &box,
84+
const geom::Rotation &rotation,
85+
float thickness = 0.1f,
86+
Color color = Color{255u, 0u, 0u},
87+
float life_time = -1.0f,
88+
bool persistent_lines = true);
89+
5890
void DrawString(
5991
const geom::Location &location,
6092
const std::string &text,

LibCarla/source/carla/client/FileTransfer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <iostream>
1313
#include <string>
1414
#include <sys/stat.h>
15+
#include <cstdint>
1516

1617
namespace carla {
1718
namespace client {

LibCarla/source/carla/client/Vehicle.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,10 @@ namespace client {
144144
BaseJSONPath);
145145
}
146146

147+
void Vehicle::RestorePhysXPhysics() {
148+
GetEpisode().Lock()->RestorePhysXPhysics(*this);
149+
}
150+
147151
rpc::VehicleFailureState Vehicle::GetFailureState() const {
148152
return GetEpisode().Lock()->GetActorSnapshot(*this).state.vehicle_data.failure_state;
149153
}

LibCarla/source/carla/client/Vehicle.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ namespace client {
137137
std::string TireJSON = "",
138138
std::string BaseJSONPath = "");
139139

140+
void RestorePhysXPhysics();
141+
140142
/// Returns the failure state of the vehicle
141143
rpc::VehicleFailureState GetFailureState() const;
142144

0 commit comments

Comments
 (0)