upkie 6.1.0
Open-source wheeled biped robots
Loading...
Searching...
No Matches
upkie.spine.spine_interface.SpineInterface Class Reference

Interface to interact with a spine from a Python agent. More...

Public Member Functions

def __init__ (self, str shm_name="/upkie", int retries=1, bool perf_checks=True)
 Connect to the spine shared memory. More...
 
def __del__ (self)
 Close memory mapping. More...
 
dict set_action (self, dict action)
 Set action for the spine to process. More...
 
dict start (self, dict config)
 Reset the spine to a new configuration. More...
 
None stop (self)
 Tell the spine to stop all actuators.
 

Detailed Description

Interface to interact with a spine from a Python agent.

Constructor & Destructor Documentation

◆ __init__()

def upkie.spine.spine_interface.SpineInterface.__init__ (   self,
str   shm_name = "/upkie",
int   retries = 1,
bool   perf_checks = True 
)

Connect to the spine shared memory.

Parameters
shm_nameName of the shared memory object.
retriesNumber of times to try opening the shared-memory file.
perf_checksIf true, run performance checks after construction.

◆ __del__()

def upkie.spine.spine_interface.SpineInterface.__del__ (   self)

Close memory mapping.

Note that the spine process will unlink the shared memory object, so we don't unlink it here.

Member Function Documentation

◆ set_action()

dict upkie.spine.spine_interface.SpineInterface.set_action (   self,
dict  action 
)

Set action for the spine to process.

Parameters
[in]actionAction dictionary.
Returns
Observation dictionary.

◆ start()

dict upkie.spine.spine_interface.SpineInterface.start (   self,
dict  config 
)

Reset the spine to a new configuration.

Parameters
[in]configConfiguration dictionary.
Returns
Observation dictionary.

The documentation for this class was generated from the following file: