mirror of
https://github.com/CopterExpress/clover.git
synced 2026-05-26 11:43:25 +00:00
docs: add an example to get the configured number of LEDs
This commit is contained in:
@@ -158,3 +158,9 @@ Current LED strip state is published in the `/led/state` ROS topic. You can view
|
||||
```bash
|
||||
rostopic echo /led/state
|
||||
```
|
||||
|
||||
Using the same topic you can get the configured number os LEDs, using Python:
|
||||
|
||||
```python
|
||||
led_count = len(rospy.wait_for_message('led/state', LEDStateArray, timeout=10).leds)
|
||||
```
|
||||
|
||||
@@ -158,3 +158,9 @@ rosservice call /led/set_leds "leds:
|
||||
```bash
|
||||
rostopic echo /led/state
|
||||
```
|
||||
|
||||
Используя этот же топик можно получить общее выставленное в настройках количество светодиодов:
|
||||
|
||||
```python
|
||||
led_count = len(rospy.wait_for_message('led/state', LEDStateArray, timeout=10).leds)
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user