SecurBot  0.1
A cutting edge robotic security platform
Classes | Functions | Variables
patrolExecutive Namespace Reference

Classes

class  Status
 

Functions

def waypointToPixelPoseStamped (waypointObject)
 Format Waypoint to Pixel PoseStamped. More...
 
def pixelPoseStampedToRealPoseStamped (pixelPoseStamped)
 Publish Pixel PoseStamped to map_image_generator to format it into Real PoseStamped. More...
 
def realPoseStampedReceiverCallback (realPoseStamped)
 Callback funtion receiving processed waypoint from map_image. More...
 
def startPatrolNavigation ()
 This function starts sending the different waypoint that were converted in the list. More...
 
def waypointsListReceiverCallback (waypointsJsonStr)
 Callback funtion that handles the reception of new patrol plans. More...
 
def interruptReceiverCallback (interruptJsonStr)
 Interprets interruption requests. More...
 
def getStatusString (uInt8Status)
 Returns status as a string, used primarly for debugging purposes. More...
 
def publishPatrolFeedBack (patrolId, status, acheivedWaypointCount, plannedWaypointCount)
 Publishes the advancement of a patrol. More...
 
def sendGoalDoneCallback (terminalState, result)
 Callback function called when an action sent to move_base is done. More...
 
def patrolExecutive ()
 Main function starting the Patrol Executive Node. More...
 

Variables

int PIXEL_POSESTAMPED_INDEX = 1
 
int REAL_POSESTAMPED_INDEX = 2
 
 actionClient = actionlib.SimpleActionClient('move_base', MoveBaseAction)
 
list waypointsPatrolList = []
 
int currentWaypointIndex = 0
 
bool isLooped = False
 
string patrolId = ""
 
 toMapImageGenerator = rospy.Publisher("toMapImageGenerator", PoseStamped, queue_size=20)
 
 toElectron = rospy.Publisher("toElectron", String, queue_size=20)
 

Function Documentation

def patrolExecutive.getStatusString (   uInt8Status)

Returns status as a string, used primarly for debugging purposes.

Parameters
uInt8Statusmove_base status code
Returns
String representation of the status
def patrolExecutive.interruptReceiverCallback (   interruptJsonStr)

Interprets interruption requests.

Will stop patrol and send confirmation if patrol plan is stopped.

Parameters
interruptJsonStrThe ROS message containing the JSON string with the interrupt message.
def patrolExecutive.patrolExecutive ( )

Main function starting the Patrol Executive Node.

Subcription to three topics are made : fromMapimageGenerator, fromElectronWaypoints, fromElectronInterrupt.

def patrolExecutive.pixelPoseStampedToRealPoseStamped (   pixelPoseStamped)

Publish Pixel PoseStamped to map_image_generator to format it into Real PoseStamped.

Parameters
pixelPoseStampedThe waypoint relative to the screen input
def patrolExecutive.publishPatrolFeedBack (   patrolId,
  status,
  acheivedWaypointCount,
  plannedWaypointCount 
)

Publishes the advancement of a patrol.

Parameters
patrolIdThe unique id of the patrol in string representation
statusString representation of the event to report
acheivedWaypointCountNumber of waypoints that have succesfully been reached
plannedWaypointCountNumber of waypoints in the current patrol
def patrolExecutive.realPoseStampedReceiverCallback (   realPoseStamped)

Callback funtion receiving processed waypoint from map_image.

Parameters
realPoseStampedThe processed waypoint in dimesions relative to RTAB-MAP
def patrolExecutive.sendGoalDoneCallback (   terminalState,
  result 
)

Callback function called when an action sent to move_base is done.

Parameters
terminalStateThe state of the action (ie: SUCCEEDED / ABORTED)
result
def patrolExecutive.startPatrolNavigation ( )

This function starts sending the different waypoint that were converted in the list.

def patrolExecutive.waypointsListReceiverCallback (   waypointsJsonStr)

Callback funtion that handles the reception of new patrol plans.

This function will decode incoming JSON message and convert the waypoints for them to be sent to move_base sequentially.

Parameters
waypointsJsonStrThe patrol plan in JSON representation
def patrolExecutive.waypointToPixelPoseStamped (   waypointObject)

Format Waypoint to Pixel PoseStamped.

Parameters
waypointObjectThe waypoint in dictionnary form from the JSON object
Returns
PoseStamped representation of the waypoint

Variable Documentation

patrolExecutive.actionClient = actionlib.SimpleActionClient('move_base', MoveBaseAction)
int patrolExecutive.currentWaypointIndex = 0
bool patrolExecutive.isLooped = False
string patrolExecutive.patrolId = ""
int patrolExecutive.PIXEL_POSESTAMPED_INDEX = 1
int patrolExecutive.REAL_POSESTAMPED_INDEX = 2
patrolExecutive.toElectron = rospy.Publisher("toElectron", String, queue_size=20)
patrolExecutive.toMapImageGenerator = rospy.Publisher("toMapImageGenerator", PoseStamped, queue_size=20)
list patrolExecutive.waypointsPatrolList = []