How would I approach a where I need PID to decrease 2D error
Background
I am currently trying to build an autonomous drone using ROS on my Rapsberry Pi which is running an Ubuntu MATE 16.04 LTS. I am using the drone to follow a bunch of red dots that I have detected using my OpenCV algorithms.
Problem Space
Now I need to move the drone. To do this, I believe the best technique would be a PID. However, looking at the documentation for a PID, it takes on a /setpoint/data
, /state/data
and outputs a /control_effort/data
. How would I deal with the 2D situation I have right now? These topics only take std_msgs/Float64
to my knowledge.
I also eventually want to adapt this for a 3D problem.
Looking quickly at the package, it is a 1d PID. If you want to control your drone in position, x,y,z, you can launch 3 PID node which you can rename in PID_x, PID_y, PID_Z for exemple. The fact that it is 1d allow you to tune it for each direction ( for a quadrotor, x = y but z will differ ).
@TTDM any chance that we can get a 2D PID node?
@TTDM also, how would I go about creating the 3D PID node? Is there a package? Do we have to launch 3 different PID nodes?
In my opinion, if you want to use this package, the easiest solution would be to launch 3 nodes with different names,
Or, you can also directly create a PID from scratch, for a simple implementation, this is only a few lines of code.
@TTDM Please add this as an answer and I will accept it!