Hello all,
In the image below, I’m trying to send message to the action_server to make the drone TAKEOFF
I’m getting the warning shown below
Following is the code I’ve written:
if goal == 'TAKEOFF':
# make the drone takeoff
self._pub_takeoff.publish(self._takeoff_msg)
# check that preempt (cancelation) has not been requested by the action client
if self._as.is_preempt_requested():
rospy.loginfo('The goal has been cancelled/preempted')
# the following line, sets the client in preempted state (goal cancelled)
self._as.set_preempted()
# build and publish the feedback message
self._feedback.feedback = i
self._as.publish_feedback(self._feedback)
# the sequence is computed at 1 Hz frequency
r.sleep()
# make the drone stop and land
elif goal == 'LAND':
self.stop_drone()
self._pub_land.publish(self._land_msg)
I tried to understand why, but couldn’t figure out. I didn’t get any satisfactory answer from Google either.
I searched in the construct forum. I found a solution shown in pic below…But, I don’t understand what the person is trying to say. Why do we even need to import CustomActionMsgResult when we didn’t give any result string in the .action file
I still gave it a shot. I imported CustomActionMsgResult and then wrote something like shown below, in goal_callback function:
_result = CustomActionMsgResult()
self._result = Empty()
Even then, the warning was thrown.
I wonder what’s causing the error and why is drone not taking off when I enter the message TAKEOFF ?