GR00T-WholeBodyControl / external_dependencies /unitree_sdk2_python /example /helloworld /subscriber.py
Download external_dependencies/unitree_sdk2_python/example/helloworld/subscriber.py from chibifire/GR00T-WholeBodyControl: direct link, hf CLI and curl.
- Browser
- Download file 526 Bytes
-
https://huggingface.co/chibifire/GR00T-WholeBodyControl/resolve/main/external_dependencies/unitree_sdk2_python/example/helloworld/subscriber.py
- Command line
-
hf download hf://chibifire/GR00T-WholeBodyControl/external_dependencies/unitree_sdk2_python/example/helloworld/subscriber.py
-
curl -L -o subscriber.py https://huggingface.co/chibifire/GR00T-WholeBodyControl/resolve/main/external_dependencies/unitree_sdk2_python/example/helloworld/subscriber.py
526 Bytes
| import time | |
| from unitree_sdk2py.core.channel import ChannelSubscriber, ChannelFactoryInitialize | |
| from user_data import * | |
| if __name__ == "__main__": | |
| ChannelFactoryInitialize() | |
| # Create a subscriber to subscribe the data defined in UserData class | |
| sub = ChannelSubscriber("topic", UserData) | |
| sub.Init() | |
| while True: | |
| msg = sub.Read() | |
| if msg is not None: | |
| print("Subscribe success. msg:", msg) | |
| else: | |
| print("No data subscribed.") | |
| break | |
| sub.Close() | |