diff --git a/CHANGELOG.md b/CHANGELOG.md index ed7c3b58c..d04ec9fc3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ * Added possibility to change gravity variable in imui sensor for the accelerometer * Fixed ROS2 native extension build error when ROS2 is installed in the system. * ROS2Native: Force fast-dds dependencies download to avoid build crash when boost_asio and tinyxml2 are not installed in Linux. + * PythonAPI `Sensor.is_listening` was defined twice (property and method), cleaned and clarified it as a method. * Added V2X sensors for cooperative awareness message and custom user-defined messages to support vehicle-to-vehicle communication ## CARLA 0.9.15 diff --git a/Docs/core_sensors.md b/Docs/core_sensors.md index 4ca9c1603..0a3ab237c 100644 --- a/Docs/core_sensors.md +++ b/Docs/core_sensors.md @@ -96,7 +96,8 @@ Sensor data differs a lot between sensor types. Take a look at the [sensors refe !!! Important - `is_listening` is a __sensor attribute__ that enables/disables data listening at will. + `is_listening()` is a __sensor method__ to check whether the sensor has a callback registered by `listen`. + `stop()` is a __sensor method__ to stop the sensor from listening. `sensor_tick` is a __blueprint attribute__ that sets the simulation time between data received. --- diff --git a/PythonAPI/carla/source/libcarla/Sensor.cpp b/PythonAPI/carla/source/libcarla/Sensor.cpp index 779738788..020b71592 100644 --- a/PythonAPI/carla/source/libcarla/Sensor.cpp +++ b/PythonAPI/carla/source/libcarla/Sensor.cpp @@ -26,7 +26,6 @@ void export_sensor() { namespace cc = carla::client; class_, boost::noncopyable, boost::shared_ptr>("Sensor", no_init) - .add_property("is_listening", &cc::Sensor::IsListening) .def("listen", &SubscribeToStream, (arg("callback"))) .def("is_listening", &cc::Sensor::IsListening) .def("stop", &cc::Sensor::Stop) diff --git a/PythonAPI/docs/sensor.yml b/PythonAPI/docs/sensor.yml index d1f118978..06e78c2a5 100644 --- a/PythonAPI/docs/sensor.yml +++ b/PythonAPI/docs/sensor.yml @@ -23,13 +23,6 @@ - [Collision detector](ref_sensors.md#collision-detector). - [Lane invasion detector](ref_sensors.md#lane-invasion-detector). - [Obstacle detector](ref_sensors.md#obstacle-detector). - - # - PROPERTIES ------------------------- - instance_variables: - - var_name: is_listening - type: boolean - doc: > - When True the sensor will be waiting for data. # - METHODS ---------------------------- methods: - def_name: listen @@ -44,6 +37,8 @@ - def_name: is_listening doc: > Returns whether the sensor is in a listening state. + return: + bool # -------------------------------------- - def_name: stop doc: > @@ -60,6 +55,8 @@ - def_name: is_enabled_for_ros doc: > Returns if the sensor is enabled or not to publish in ROS2 if there is no any listen to it. + return: + bool # -------------------------------------- - def_name: listen_to_gbuffer params: @@ -83,6 +80,8 @@ The ID of the target Unreal Engine GBuffer texture. doc: > Returns whether the sensor is in a listening state for a specific GBuffer texture. + return: + bool # -------------------------------------- - def_name: stop_gbuffer params: