Finite state machine Node
- Brief explanation of this node:
Add individuals to classes (ROOM, DOOR, ROBOT)
Disjoint individuals (ROOM, DOOR)
Assign DOORs to ROOMs
Use last visited times method for update time visit
Add robot in map and set first pose
Use urgency threshold method for visit all the rooms
Add battery lvl of robot and use charge and discharge method
Get pose client and get location of robot to get current pose of robot
Update ontological map
Moves robot between different ROOMs
Run smach viewer to show current sate of robot
- Publishe :
/target_point to ‘planner_client’ node
- Service :
GET_POSE to get robot pose from ‘robot_state’ node
- scripts.finite_state_machine.SMACH_state_machine()[source]
Function to create a SMACH state machine and start the introspection server for visualization and execute the state machine.
- scripts.finite_state_machine.add_battery_level()[source]
Function to create battery level for robot, battery level of robot is 20 percent.
- scripts.finite_state_machine.add_individuals_to_classes()[source]
Function to add all individuals like ROOMs, DOORs, and ROBOT into the class of topological map
- scripts.finite_state_machine.add_last_visit_times()[source]
Function to update the last time the robot was there
- scripts.finite_state_machine.add_urgency_threshold()[source]
Function to creat an urgency threshold in case more than 7 secs have passed since the last time the robot was there
- scripts.finite_state_machine.assign_doors_to_rooms()[source]
Function to assign DOORs to ROOMs in topological map
- scripts.finite_state_machine.charge_battery()[source]
Function to charge battery of robot. If battery level of robot is equal to 20 function stops.
- scripts.finite_state_machine.consume_battery()[source]
Function to consume battery of robot when robot move between ROOMs.
- scripts.finite_state_machine.cut_dataprop(data_prop)[source]
Very simple function that cut the data prop from a string received from armor.
- Returns
data_prop(float)
- scripts.finite_state_machine.cut_dataprop_list(data_prop_list)[source]
Very simple function that cut the data prop from a list of strings received from armor.
- Returns
data_prop(float)
- scripts.finite_state_machine.disjoint_individuals()[source]
Function to disjoint individuals like ROOMs and DOORs in topological map
- scripts.finite_state_machine.get_location()[source]
Function to detect robot current location and replace new location with previous location.
- Returns
current location of robot
- Return type
is_in(string)
- scripts.finite_state_machine.get_pose_client()[source]
- Function to retrieve the current robot pose by the state/get_pose
server of the robot-state node.
- scripts.finite_state_machine.move_robot(x, y)[source]
Function to move the robot to specific coordinate
- Parameters
x (float) – x-coordinate of the target room
y (float) – y-coordinate of the target room
- scripts.finite_state_machine.move_robot_to_corridor1()[source]
Function to move robot to CORRIDOR 1
- scripts.finite_state_machine.move_robot_to_corridor2()[source]
Function to move robot to CORRIDOR 2
- scripts.finite_state_machine.move_to_room(room)[source]
Function to move to target room
- Arg:
room(string): target room
- scripts.finite_state_machine.update_ontology()[source]
Function to update topological map and sync the reasoner. If pass more than 7 secs since the last time robot was there, the location is added to the list of URGENT locations to visit. If battery level of robot less than 7, the robot first has to go to ROOM E to charge.
- Returns
next destination to vist
- Return type
target_room(string)