Intelligent-Quads / iq_tutorials

MIT License
446 stars 250 forks source link

issue regarding the using of velocity setpoint and position setpoint at the same time #21

Open hariharvin opened 3 years ago

hariharvin commented 3 years ago

Hi, i am new to GitHub if any mistakes are there please forgive me

I am trying to maintain a matrix formation of four vehicles .I am using algorithm such that it checks vehicle position for every one second .If any deviation is there the vehicle has to cover deviation in next one second so vehicle needs to travel with more velocity than previous velocity of the same vehicle .

So i am trying to set the velocity and position set points at the same time so that vehicle reaches that next position in same time as other vehicles corresponding positions to maintain formations. But the vehicle is not reaching the given position although it is taking the velocities.

I am using /mavros/setpoint_raw/local ,i am setting required bit mask also ..

what could be the mistake ? Can anybody guide me to Implement this ?

ericjohnson97 commented 3 years ago

Sorry for the late response. XD. the easiest way to do this would be to use the default position controllers built into ardupilot, but use set_speed in the iq_gnc api to update the desired speed to the waypoint.

https://github.com/Intelligent-Quads/iq_tutorials/blob/master/docs/GNC_functions_documentation.md#int-set_speedfloat-speed__mps