Skip to content

Instantly share code, notes, and snippets.

@SqrtRyan
Created September 16, 2025 08:14
Show Gist options
  • Save SqrtRyan/91fc0b56b86121469cef84ebf150c7bb to your computer and use it in GitHub Desktop.
Save SqrtRyan/91fc0b56b86121469cef84ebf150c7bb to your computer and use it in GitHub Desktop.
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