Adjusting Flying distance and course in Aruco Landing sim


#1

I just finished building the code for Aruco landing, i.e. gazebo_precision_landing.py. I’d like to adjust the flying course after takeoff and before initiaing precision landing. Any suggestions?
Cheers,
Daniel


#2

Could you be a bit more specific how you want to ‘adjust’ the course?

For example, if you want to fly to a specific waypoint with an Aruco marker from your Home location, you could add a goto(wp) statement based on an assigned wp geo location where x = lat, y = lon and z = alt:


image


#3

This is very helpful, thank you.
More clearly put: I’d like to:

  1. initiate takeoff to a given height
  2. navigate to a point in space and hover for 5 seconds
  3. Navigate to another point in space and hover for 10 seconds.
  4. Then return to the original takeoff spot, marked with an aruco marker.

Also, I’m curious if there’s a certain location within the code where the function and command you shared should go within the context of gazebo_precision_landing.py?
Thanks,
Daniel


#4

Actually the taco delivery lesson goes over this sort of thing. Use that and what I said above for your mission.


The goto() function includes a time.sleep(x) function that you can adjust to 5 seconds or whatever. Or you can put the sleep function for hovering outside the if statement and between waypoints down in your executables.
image
Add as many waypoints as you want, the last is the original takeoff spot. Alternatively you can create a list of waypoints and then use a for loop to run through each. You might want to switch to Loiter mode when hovering over a waypoint, then switch back to Guided before going to the next place.

Regarding your last question, study the structure of the gazebo_precision_landing.py or taco_delivery.py code. I would modify the taco_delivery.py code. Add waypoints and remove the lander() function until you go home. You can remove the controlServo() function unless you want to drop something.