Skip to content

Commit

Permalink
Corrected information that Sensor.is_listening is a method
Browse files Browse the repository at this point in the history
  • Loading branch information
Daraan committed Apr 15, 2024
1 parent f22d49d commit 7ff0929
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
3 changes: 2 additions & 1 deletion Docs/core_sensors.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

---
Expand Down
1 change: 0 additions & 1 deletion PythonAPI/carla/source/libcarla/Sensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ void export_sensor() {
namespace cc = carla::client;

class_<cc::Sensor, bases<cc::Actor>, boost::noncopyable, boost::shared_ptr<cc::Sensor>>("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)
Expand Down
13 changes: 6 additions & 7 deletions PythonAPI/docs/sensor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <b>True</b> the sensor will be waiting for data.
# - METHODS ----------------------------
methods:
- def_name: listen
Expand All @@ -44,6 +37,8 @@
- def_name: is_listening
doc: >
Returns whether the sensor is in a listening state.
return:
bool
# --------------------------------------
- def_name: stop
doc: >
Expand All @@ -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:
Expand All @@ -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:
Expand Down

0 comments on commit 7ff0929

Please sign in to comment.