Ronoco-VM API - Behaviour documentation
The Behaviour module is the implementation in Ronoco-vm of the different blocks accessible from Node-RED. Indeed, each block on Node-RED (plan, execute, cartesian etc) is associated with a treatment in Ronoco-vm. The beahviour module is the heart of this processing and allows to identify the existing blocks and to associate functions to them.
Behaviour
List the existing blocks and their type (control node, execution nodes etc).
Defines the functions allowing to instantiate the different blocks while checking the content of the parameters.
The interface implemented forces all these functions to have name, data and child parameters.
- name: The name of the block (optional)
- data: The data used to build the block (optional for some blocks, mandatory for others)
- child: the child of the block to instantiate in the behaviour tree (mandatory for decorators)
selector
Instantiates a selector node
A selector executes each of its child behaviours in turn until one of them succeeds (at which point it itself returns RUNNING or SUCCESS, or it runs out of children at which point it itself returns FAILURE. We usually refer to selecting children as a means of choosing between priorities. Each child and its subtree represent a decreasingly lower priority path.
sequence
Instantiates a sequence node
A sequence will progressively tick over each of its children so long as each child returns SUCCESS. If any child returns FAILURE or RUNNING the sequence will halt and the parent will adopt the result of this child. If it reaches the last child, it returns with that result regardless.
The sequence halts once it sees a child is RUNNING and then returns the result. It does not get stuck in the running behaviour.
parallel
Instantiates a parallel node
Ticks every child every time the parallel is run (a poor man’s form of paralellism).
- Parallels will return FAILURE if any child returns FAILURE
- Parallels with policy SUCCESS_ON_ONE return SUCCESS if at least one child returns SUCCESS and others are RUNNING.
- Parallels with policy SUCCESS_ON_ALL only returns SUCCESS if all children return SUCCESS
condition
Instantiates a condition node
Encapsulates a behaviour and wait for its status to flip to the desired state. This behaviour will tick with RUNNING while waiting and SUCCESS when the flip occurs.
- data: SUCCESS, FAILURE or RUNNING
- child: must be provided
inverter
Instantiates a inverter node
A decorator that inverts the result of a class’s update function.
- child: must be provided
timeout
Instantiates a timeout node
A decorator that applies a timeout pattern to an existing behaviour. If the timeout is reached, the encapsulated behaviour’s stop() method is called with status FAILURE otherwise it will simply directly tick and return with the same status as that of it’s encapsulated behaviour.
- data: time in seconds as an integer
- child: must be provided
execute
Execute the movement between the current position and a position given in the constructor parameter.
Use MoveGroupCommander.set_pose_target() and MoveGroupCommander.go()
- data: identifier of a point as an integer
plan
Planning movement between the current position and a position given in the constructor parameter.
Use MoveGroupCommander.set_pose_target() and MoveGroupCommander.plan()
- data: identifier of a point as an integer
cartesian
Cartesian movement between the current position and a position given in the constructor parameter
Use geometry_msgs.msg.PoseStamped(), MoveGroupCommander.compute_cartesian_path() and MoveGroupCommander.execute()
- data: a dictionary like {'point_id' : integer, 'reliability': integer (0-100), 'eef' : float}
record
Record all trajectories during a time specified by a parameter in constructor
- data: a dictionary like {'identifiant' : string, 'time': integer}
replay
Replays a previously recorded path
- data: name of a recorded trajectory as a string
service
Allows you to call a service offered by the robot. Perform rosservice list
to get the list of available services
- name: String - name of current block
- name of service: String - The name of the service to be called. The name must not be preceded by a /.
- Parameters of service: Array - The parameters to be provided to the service. The parameters must be enclosed in brackets and separated by commas.
end_effector
Allows control of the robot end effector via an associated service passed as a parameter to ronoco.launch (the robot end effector controller must be started independently).
This block returns SUCCESS if it has succeeded in completing the action and FAILURE if it has caught something in its path. Otherwise, the combination of "end_effector" and an "inverter" will return SUCCESS if the robot has caught something.
- name: String - name of current block
- Data: Array - The parameters to be provided to the service. The parameters must be enclosed in brackets and separated by commas.