def on_enter(self, userdata): # When entering this state, we send the action goal once to let the robot start its work. # As documented above, we get the specification of which dishwasher to use as input key. # This enables a previous state to make this decision during runtime and provide the ID as its own output key. # Create the goal. goal = StalkPoseGoal() goal.runtime_sec = 60 goal.topic_name = self._personTopic goal.target = userdata.person_pose self._error = False self._timeoutTime = rospy.Time.now() + rospy.Duration(20)
def on_enter(self, userdata): # When entering this state, we send the action goal once to let the robot start its work. # As documented above, we get the specification of which dishwasher to use as input key. # This enables a previous state to make this decision during runtime and provide the ID as its own output key. # Create the goal. goal = StalkPoseGoal() goal.runtime_sec = 60 goal.topic_name = self._personTopic goal.target = userdata.person_pose self._error = False self._timeoutTime = rospy.Time.now() + rospy.Duration(20) try: self._client.send_goal(self._topic, goal) except Exception as e: # Since a state failure not necessarily causes a behavior failure, it is recommended to only print warnings, not errors. # Using a linebreak before appending the error log enables the operator to collapse details in the GUI. Logger.logwarn('Failed to send the ApproachPerson command:\n%s' % str(e)) self._error = True