docs: add an example to get the configured number of LEDs

This commit is contained in:
Oleg Kalachev
2022-04-05 08:24:33 +04:00
parent b7d74ef6c9
commit e3addb9eb0
2 changed files with 12 additions and 0 deletions

View File

@@ -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)
```

View File

@@ -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)
```