Problem with Exercise 9.13 : cannot land a drone and result of the action doesn't appear

Hello, I need to find out a solution to the problem I am currently facing with Exercise 9.13.
Whenever I run simulations, I could never land a drone and it was just hovering in the air while spinning. Just to clarify, I put the same launch and script codes that were in the solution page, and followed the same exact instructions. Although I could see a drone moving in square at first, the drone did not land as expected and printed an error right after it printed out the time it needed for a drone to perform a square. It couldn’t print ‘Landing …’ as it was supposed to do. And echoing the results topic didn’t do anything.

I took a picture of shell script after an error, and this was what it showed. To me I think the main problem has to be with the last line “To transition to an aborted state, the goal must be in a preempting or active state, it is currently in state: 3”. I am not aware of the full meaning of this but I assume this error message has to do with the fact that 3 feedbacks were given instead of 2 even though I set the state of goal to 2.

From this point on I have zero clue. No solutions from other internet sources were clear enough for me and mostly unrelated, so I need you guys’ help.

The challenge here is that you need to understand any code you copy because it may not work out of the box for you and because you may not copy it right.

We don’t encourage students just copying the solutions - the intention is not to give you something that works perfectly, but to guide you in fixing your own code. Please develop your own logic for the exercise.

The key to the problem is in the error

result.result must be an integer...

and this error is happening when the action is about to return a result.

As for the drone not landing, you can check the following:

I solved the error by converting “self._result.result” into an integer value by using class int().
I also made my own code, and faced the same exact error and that was why I double checked it with the code in the solutions page. I won’t copy the solutions before figuring them out myself ever again.
Thank you so much for the answer.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.