ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
2

I need help writing a controller node for a drone

asked 2017-01-12 04:12:47 -0500

serf gravatar image

updated 2017-01-13 07:07:19 -0500

I tried searching alot, and couldnt find any good tutorials for learning how to write a controller node for a drone, (though this was informative http://gazebosim.org/tutorials/?tut=r... )

I want to write a controller node for autonomous drone movement, as defined in a cpp file,

ie: set yaw=value for a small time, then pitch=value (to move forward), then throttle=value to move up and so forth.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2017-01-13 08:25:09 -0500

updated 2017-01-15 16:39:55 -0500

I would advise you to look into the Ardunio Pilot open source project, what you're trying to achieve is incredibly difficult. People have put tens of thousands of hours into developing UAV autopilots and there are some very good ones out there.

Get one of these systems working for you, and become familiar with how they operate and then decide if it's really something you want to try and build from scratch.

I'm not trying to put you off at all, I've worked on a few really fascinating projects with autonomous drones. It's a lot of fun, but you don't have to re-invent such a complex wheel yourself.


Ah okay, now I see what you're trying to achieve. You want to build a ros node that can link to a UAV using the MAVLINK protocol to then control what that UAV does. The link you posted should be a good place to start.

But what exactly are you trying to make the UAV do? The MAVLINK protocol is quick high level, you don't have any control over the UAV's pitch, that is entirely under control of the autopilot. You can however tell the UAV to fly to a particular waypoint using a MAV_CMD_NAV_FOLLOW command, this position can then be updated to make drone move around.

Think about it like this, using the MAVLINK you can be the navigator of the drone, and tell it where to be and where to go. But the on-board outpilot will always be the driver, and will control the pitch, yaw and throttle of the drone. These use complex control algorithms and estimates of the current position from multiple sensors in order to safely fly the drone. Most autopilots will also ignore any mavlink commands if the battery is a dangerously low and return to their landing site and land safely for example. If you can tell me a bit more about your project I'll see if I can get you started.

edit flag offensive delete link more

Comments

sorry, i just want to do something similar to https://github.com/SujithSizon/ifor_o... using a controller, using existing controller is also is fine, it just needs to be autonomous, problem is i cant find tutorials specific to a quad anywhere

serf gravatar image serf  ( 2017-01-15 06:16:22 -0500 )edit

I also want to write my own controller for quadrotor so it would be great if you suggest some tutorials and and some material to start with, basically i want to know that how roll, pitch, yaw etc. are set and what values should be given so that it can maintain its balance and what algorithm we can use to get these values and from where we can find these type algorithm to set the motor values.

Gourav Badone gravatar image Gourav Badone  ( 2019-07-31 01:12:29 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2017-01-12 04:12:47 -0500

Seen: 1,126 times

Last updated: Jan 15 '17