I want to be able to tell my quadcopter to fly(bearing, time, speed).......This will allow me to essentially say fly forward 1cm or fly left 10 cm etc.
1) Where in the software stack ( Mission Planner Scripts, Drone kit, APM code, pixhawk code) is the easiest place to issue such a command?
2) Can you point me in the right direction, where I can find a list of the commands that will alllow me to do this?
Note: I dont want to issue gps waypoints and I dont want to issue motor speeds. Issuing motor speeds, will force me to write code that translates the 4 motor's speeds into distance traveled which requires complex aerodynamics, inertia modelling....I simply want to issue a command fly(forward, 1 second, 1 m/s) or fly (80 degrees, 3 seconds, 4m/s) etc
Any thoughts?
Replies
J'Rome,
If you can somehow issue mavlink commands you can put the vehicle in Guided mode and then send either SET_POSITION_TARGET_LOCAL_NED or SET_POSITION_TARGET_GLOBAL_INT. This is how dronekit is doing it. Note that those commands allow sending velocities. Getting the "type_mask" field correct so that only the velocities are used is a touch tricky as it requires some minor bit math but it can be done of course.
You won't be able to directly specify how long it should fly at that speed though. Basically the vehicle will try to fly at that velocity until it receives another velocity command or it timesout (which is 2 or 3 seconds I think). So basically you'll need to keep sending the command at 1hz (or whatever) for as long as you want it to keep flying and/or ramp-up and ramp-down the velocity request.
By the way Copter-3.4 (now in beta testing) automatically ramps up/down the velocity for you so it's a little easier to use.
Thanks kindly, I found exactly what I was looking for.
However, DroneKIT is not integrated with the Gazebo SITL simulator. I was hoping to use Gazebo or V-rep or a robotics indoor simulator to develop my fly(bearing, speed, time) code. ie DroneKit will need to speak to Gazebo or V-rep and currently does not.
Are there any other ways of commanding fly(bearing, speed, time) that will allow me to leverage Gazebo or V-Rep?
Thanks kindly
J'Rome Henry
Chris Anderson said:
That's easy: Velocity control in Dronekit