Finite state machine Node

Brief explanation of this node:
  1. Add individuals to classes (ROOM, DOOR, ROBOT)

  2. Disjoint individuals (ROOM, DOOR)

  3. Assign DOORs to ROOMs

  4. Use last visited times method for update time visit

  5. Add robot in map and set first pose

  6. Use urgency threshold method for visit all the rooms

  7. Add battery lvl of robot and use charge and discharge method

  8. Get pose client and get location of robot to get current pose of robot

  9. Update ontological map

  10. Moves robot between different ROOMs

  11. 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

class scripts.finite_state_machine.Corridor1[source]

Class to define state Corridor 1

execute(userdata)[source]

Function called when exiting from the node, it can be blacking

class scripts.finite_state_machine.Corridor2[source]

Class to define state Corridor 2

execute(userdata)[source]

Function called when exiting from the node, it can be blacking

class scripts.finite_state_machine.Room1[source]

Class to define state Room 1

execute(userdata)[source]

Function called when exiting from the node, it can be blacking

class scripts.finite_state_machine.Room2[source]

Class to define state Room 2

execute(userdata)[source]

Function called when exiting from the node, it can be blacking

class scripts.finite_state_machine.Room3[source]

Class to define state Room 3

execute(userdata)[source]

Function called when exiting from the node, it can be blacking

class scripts.finite_state_machine.Room4[source]

Class to define state Room 4

execute(userdata)[source]

Function called when exiting from the node, it can be blacking

class scripts.finite_state_machine.RoomE[source]

Class to define state Room E

execute(userdata)[source]

Function called when exiting from the node, it can be blacking

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_robot()[source]

Function to add robot in topological map

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_robot_to_room1()[source]

Function to move robot to ROOM 1

scripts.finite_state_machine.move_robot_to_room2()[source]

Function to move robot to ROOM 2

scripts.finite_state_machine.move_robot_to_room3()[source]

Function to move robot to ROOM 3

scripts.finite_state_machine.move_robot_to_room4()[source]

Function to move robot to ROOM 4

scripts.finite_state_machine.move_robot_to_roomE()[source]

Function to move robot to ROOM E

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)