Skip to content

Commit

Permalink
Add missing conversion class from vector of WheelTelemetryData to Pyt…
Browse files Browse the repository at this point in the history
…hon list

Add missing conversion class from vector of WheelTelemetryData to Python list

This adds a missing conversion from vector of WheelTelemetryData to a Python list. When trying to access the "wheels" attribute of the VehicleTelemetryData without this, this exception will occur:

TypError: No to_python (by-value) converter found for C++ type: std::vector<carla::rpc::WheelTelemetryData, std::allocator<carla::rpc::WheelTelemetryData>>

This addition fixes this issue to make the usage in line with similar classes such as "VehiclePhysicsControl" and "WheelPhysicsControl" 

Checklist:
- [x] Your branch is up-to-date with the dev branch and tested with latest changes.
- [x] Extended the README/documentation, if necessary.
- [x] Code compiles correctly.
- [x] All tests passing with make check.
  • Loading branch information
BBArikL authored Aug 26, 2024
1 parent 1ef3f55 commit 6ffa41a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions PythonAPI/carla/source/libcarla/Control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,11 @@ void export_control() {
.def(self_ns::str(self_ns::self))
;

class_<std::vector<carla::rpc::WheelTelemetryData> >("vector_of_wheels_telemetry")
.def(vector_indexing_suite<std::vector<carla::rpc::WheelTelemetryData> >())
.def(self_ns::str(self_ns::self))
;

class_<cr::WheelTelemetryData>("WheelTelemetryData")
.def(init<float, float, float, float, float, float, float, float, float, float, float>(
(arg("tire_friction")=0.0f,
Expand Down

0 comments on commit 6ffa41a

Please sign in to comment.