reachy.io.ws

WebSocket IO definition.

Module Contents

Classes

WsIO

WebSocket IO implementation.

WsMotor

Motor Placeholder.

WsFakeOrbitaDisk

Orbital disk placeholder.

WsFakeForceSensor

Force Sensor placeholder.

WsDualCamera

Remote Camera.

WsServer

WebSocket server, sync value from the modules with their equivalent from the client.

FakeFan

Fake fan module for API consistensy.

class reachy.io.ws.WsIO(part_name)

Bases: reachy.io.io.IO

WebSocket IO implementation.

ws
classmethod shared_server(cls, part_name)

Create a new io with its ws server.

find_module(self, module_name)

Get a specific module from the IO.

For the moment no module are really implemented. Only placeholders for code compatibility are provided.

find_dxl(self, dxl_name, dxl_config)

Get a specific dynamixel motor from the IO.

Only goal position is used atm.

find_fan(self, fan_name)

Get a specific fan from its name.

find_orbita_disks(self)

Get a specific orbita module from the IO.

Not currently supported.

find_camera(self, index)

Retrieve a dual camera.

close(self)

Close the WS.

class reachy.io.ws.WsMotor(name, initial_position)

Bases: object

Motor Placeholder.

Only the goal position (ie. target_rot_position) is currently used.

class reachy.io.ws.WsFakeOrbitaDisk(name, initial_position)

Bases: object

Orbital disk placeholder.

__repr__(self)str

Public Orbita disk string representation.

setup(self)

Initialize the disk.

property rot_position(self)

Get the current disk angle position (in deg.).

property temperature(self)

Get the current temperature in C.

property target_rot_position(self)

Get the current target angle position (in deg.).

class reachy.io.ws.WsFakeForceSensor

Bases: object

Force Sensor placeholder.

Always return a nan as force.

class reachy.io.ws.WsDualCamera(side)

Bases: object

Remote Camera.

read(self)

Get latest received frame.

close(self)

Close the camera.

class reachy.io.ws.WsServer(host='0.0.0.0', port=6171)

Bases: object

WebSocket server, sync value from the modules with their equivalent from the client.

async sync(self, websocket, path)

Sync loop that exchange modules state with the client.

close(self)

Stop the sync loop.

register(self, io)

Register a new io (and its module) to be synced.

run_forever(self)

Run the sync loop forever.

run_in_background(self)

Run the sync loop forever in background.

class reachy.io.ws.FakeFan

Bases: object

Fake fan module for API consistensy.

on(self)

Do nothing.

off(self)

Do nothing.