Created
September 16, 2025 08:14
-
-
Save SqrtRyan/91fc0b56b86121469cef84ebf150c7bb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import booster_robotics_sdk_python as B | |
def set_global(name, value): | |
globals()[name] = value | |
@globalize_locals | |
def _init_communication() -> None: | |
if not "INITIALIZED" in globals(): | |
B.ChannelFactory.Instance().Init(0) | |
# low_cmd_publisher = B1LowCmdPublisher() | |
# low_cmd_publisher.InitChannel() | |
# low_cmd = LowCmd() | |
client = B.B1LocoClient() | |
client.Init() | |
handler = partial(set_global, "low_state") # Low Level State | |
low_state_subscriber = B.B1LowStateSubscriber(handler) | |
low_state_subscriber.InitChannel() | |
INITIALIZED = True | |
def set_mode_custom (): return client.ChangeMode(B.RobotMode.kCustom ) | |
def set_mode_prepare(): return client.ChangeMode(B.RobotMode.kPrepare) | |
_init_communication() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment