API
RISE is designed to allow external components to start and interrupt configurable Behaviors on the RISE-Scheduler. These Behaviors can be configured internally and are controllable from other applications. The way of controlling such behaviors is ROS.
Using RISE-Functions
Use RISE-Functions inside a DomainTask
Topic: /rise/set/domainTask/goal
Message: ros_tcp_endpoint/DomainTaskActionGoal
rostopic pub -1 /rise/set/domainTask/goal ros_tcp_endpoint/DomainTaskActionGoal
"header:
seq: 0
stamp:
secs: 0
nsecs: 0
frame_id: ''
goal_id:
stamp:
secs: 0
nsecs: 0
id: ''
goal:
domain_task_behavior: ''
function_type: ''
calling_type: ''"
Parameter |
Type |
Description |
---|---|---|
|
|
Required. Name or description of the Behavior |
|
|
Required. Name of Function Function-Types |
|
|
|
Function-Types and Behaviors
Function-Type |
Description |
Example DomainTask-Behaviors |
---|---|---|
|
Start CRA on scheduler |
Name of CRA which is defined in Configurations |
|
Stop CRA |
Name of CRA which is defined in Configurations |
|
Start IR |
Name of IR which is defined in Configurations |
|
Stop IR |
Name of IR which is defined in Configurations |
|
Raise internal EvenTopic |
Name of Topic which should be raised internally |
|
Set Working-Memory entry |
Json Key-Value Pair: |
Calling-Types
None
: Goal is handled without any restrictions for scheduling and is not blocking other tasks and can be interrupted.Blocking
: Goal cannot be interrupted by other goals.
Cancel a DomainTask
Topic: /rise/set/domainTask/cancel
Message: actionlib_msgs/GoalID
rostopic pub -1 /rise/set/domainTask/cancel actionlib_msgs/GoalID
"stamp:
secs: 0
nsecs: 0
id: ''"
Parameter |
Type |
Description |
---|---|---|
|
|
Required. Id of DomainTask to cancel |
Request Working Memory Informations
Topic: /rise/set/memoryService
Call: /rise/set/memoryService "request_by_key: ''"
rosservice call /rise/set/memoryService "request_by_key: ''"
Parameter |
Type |
Description |
---|---|---|
Input: |
|
Required. Key in Working-Memory |
Output: |
|
Required. Json Key-Value Pair (“{“key”:value}”) |
Receiving Informations about DomainTasks
Receive Result of a DomainTask
Topic: /rise/set/domainTask/result
Message: ros_tcp_endpoint/DomainTaskActionResult
Parameter |
Type |
Description |
---|---|---|
|
|
Required. Id of DomainTask |
|
|
Required. Result in 1 (true) or 0 (false) |
Receive Status of a DomainTask
Topic: /rise/set/domainTask/status
Message: actionlib_msgs/GoalStatusArray
rostopic echo /rise/set/domainTask/status
Receive Feedback of a DomainTask
Topic: /rise/set/domainTask/feedback
Message: ros_tcp_endpoint/DomainTaskActionFeedback
rostopic echo /rise/set/domainTask/feedback
Receive Status of internal RISE-States
Topic: /rise/state/update
Message: std_msgs/String
Parameter |
Type |
Description |
---|---|---|
|
|
Required. Current State of RISE |
Example of the output of a message from RISE to external components about the previos state (WaitingForTimer
), the current state (AutonomousLife
) and the state-change as transition (/R_Wait_Idle_end
) of a specific InteractionRule (R_background_behavior
).
data: "{\"interactionrule_name\":\"R_background_behavior\",
\"previous_state\":\"WaitingForTimer\",
\"transition_event\":\"/R_Wait_Idle_end\",
\"current_state\":\"AutonomousLife\"}"
You can access this update message in Python, for instance, by deserializing the values by keys from the JSON format:
rise_state_prev_state = json.loads(data.data)["previous_state"]
rise_state_event = json.loads(data.data)["transition_event"]