Bindings

All binding informations is generated from actual master branch of the source repository.

print

Prints data, output channel of this command depends on context.

example:

print( "fooo: ", 123 )

type:

callback

args:
…:
Any arguments provided
(convertible by luaL_tolstring)

set_servo_config

sets configuration to servo

example:

set_servo_config{ joints={"abc", ...}, vars={0.} }

type:

callback

args:
joint/joints:
joints to be configured(either provide on joint, or list of them)
(string array)
vars:
set of config for servo
(any lua data convertible to json)

get_system_time

Returns actual system time in milliseconds

example:get_system_time{}
type:callback
returns:

(unsigned)

get_leg_state

returns actual state of the leg

example:

get_leg_state{ leg="abc" }

type:

callback

args:
leg:
name of the requested leg
(string)
returns:
angles representing state
(number rad array)

get_tip_pos

returns tip position of leg, when joints are in provided configuration

example:

get_tip_pos{ leg="abc", angles={1., ...} }

type:

callback

args:
leg:
name of the requested leg
(string)
angles:
a set of angles for given leg
(number rad array)
returns:
point relative to robot frame
(3D point in robot frame (number array) )

joint_goto

moves join to desired ‘pos’ in ‘time’

example:

joint_goto{ joints={"abc", ...}, pos=1., time=1. }

type:

callback

args:
joint/joints:
joints to be moved(either provide on joint, or list of them)
(string array)
pos:
position for the movement
(number)
time:
time for the movement in ms
(number)

joint_spin

spins joint for ‘time’ with ‘velocity’

example:

joint_spin{ joints={"abc", ...}, velocity=1., time=1. }

type:

callback

args:
joint/joints:
joints to be spinned(either provide on joint, or list of them)
(string array)
velocity:
velocity of the spin
(number)
time:
how long does the spin take in ms
(number)

send_read_pos

sends command for reading the position of joint

example:

send_read_pos{ joints={"abc", ...} }

type:

callback

args:
joint/joints:
joints that will be reported(either provide on joint, or list of them)
(string array)

sync

synchronizes execution of event-commands until all previous events are finished

example:

sync{ joints={"abc", ...} }

type:

callback

args:
joint/joints:
joints that should be synchronized(either provide on joint, or list of them)
(string array)
returns:
id of the message
(unsigned)

get_joints

returns list of active joints

example:get_joints{}
type:callback
returns:
list of joints
(string array)

tip_goto

Moves tip of the leg to position ‘target’ in ‘time’. ‘steps’represents number of iterations of the algorithm that solves the IK formula.

example:

tip_goto{ leg="abc", time=1., target={1.,1.,1.} }

type:

callback

args:
leg:
leg to be moved
(string)
time:
time of the movement
(number)
target:
target position of the tip of the leg
(3D point in world frame (number array) )
[steps]:
number of steps the IK solver
(unsigned)

relative_tip_goto

Moves tip of the leg to position target in time. The target represents position relative to the positon of body

example:

relative_tip_goto{ leg="abc", time=1., target={1.,1.,1.} }

type:

callback

args:
leg:
leg to be moved
(string)
time:
time of the movement
(number)
target:
target relative position of the tip of the leg
(3D point in robot frame (number array) )
[steps]:
number of steps the IK solver
(unsigned)

tip_move

Moves tip of the leg in ‘dir’ for ‘time’. ‘steps’ represents number of iterations of the algorithm that solves the IK formula.

example:

tip_move{ leg="abc", time=1., dir={1.,1.,1.} }

type:

callback

args:
leg:
leg to be moved
(string)
time:
time of the movement
(number)
dir:
direction of the movement as vector
(3D vector (number array))
[steps]:
numer of steps the IK solver
(unsigned)

body_goto

Moves the body into a absolute coordinate specificed by pose in time.

example:

body_goto{ point={1.,1.,1.}, orientation={0.,0.,0.,1.}, time=1. }

type:

callback

args:
point/orientation:
 
The desired pose (you either specifiy both parts, or one of them. The missing one is taken from actual pose.)
(3D point in world frame (number array) , quaternion in world frame ({axis, angle}))
time:
time of movement
(number)
[steps]:
number of steps the IK solver
(unsigned)

body_move

Moves body of the robot in direction ‘dir’ and rotates it by ‘rot’, by moving all legs in opposite direction, this is done in ‘time’. ‘steps’ represents number of iterations of the algorithm that solves the IK formula.

example:

body_move{ dir={1.,1.,1.}, rot={0.,0.,0.,1.}, time=1. }

type:

callback

args:
dir:
direction of body movement
(3D vector (number array))
rot:
rotation of the body
(quaternion in robot frame ({axis, angle}))
time:
time of the movement
(number)
[steps]:
number of steps the IK solver
(unsigned)

set_body_pose

Sets actual pose of the body of the robot relative to world frame

example:

set_body_pose{ point={1.,1.,1.}, orientation={0.,0.,0.,1.} }

type:

callback

args:
point/orientation:
 
The desired pose of the body in world frame (you either specifiy both parts, or one of them. The missing one is taken from actual pose.)
(3D point in world frame (number array) , quaternion in world frame ({axis, angle}))

sync_cb

Table of callbacks for messages

type:global variable

msg_cb

Callbacks for messages

type:global variable

on_cmd

Function is called each time msg is received from firmware

type:called lua procedure

on_msg

executes callback when specific type of message arrives

example:

on_msg{ key="abc", cb=function() ... end }

type:

lua procedure

args:
key:
id of message
(string)
cb:
callback
(nullary callback)

on_sync

synces and executes callback when that sync finishes

example:

on_sync{ joints={"abc", ...}, callback=function() ... end }

type:

lua procedure

args:
joints:
Joints which should be waited for
(string array)
callback:
callback to be executed
(nullary callback)

block_yield

blocks execution until all joints finish their task

example:

block_yield{ joints={"abc", ...} }

type:

lua procedure

args:
joints:
Joints which should be waited for
(string array)

Chain

Chain converts a coroutine into a iterable event loop. This makes it possible to chain up complex movements into one thing.

example:chain:new(function () ... end):exec()
type:class