For agricultural drones spraying pesticides, path planning is a rastor scan. I want to avoid the obstacle and join the path again, to ensure spraying is done without loosing much field area. I’ll stop in front of an obstacle, and user can take control in loiter mode, avoid and align with main path and continue the mission. (this can later be replaced by 100% autonomy, to merge tightly with the path) This would ensure that the remaining pass to the waypoint can be sprayed autonomously
Also, once stop is implemented it gives me flexibility to modify behavior from CC.
Instead of trajectory planning (Bendy ruler/ DJikstra), I am trying to implement stop mode (like loiter) upon detecting obstacle in automission.
However AUTO controller is a bit complicated and I need help in the following respects
- Similar to slowing down for terrain correction using offset_z_scaler, I was thinking to implement offset_oa_scaler which varies between 0 and 1 based on distance from obstacle.
Bits of code in AC_WPNAV.cpp which I changed are as:
a) Adding loiter obstacle avoidance adjust_velocity function
b)adding offset_oa_scale and multiplying it with offset_z_scaler during velocity planning.
On SITL simulations the drone comes to a stop atleast when obstacle is in front and then continues the automission on removing the obstacle.
However, I dont understand if there is a better way to do it (since I am not changing the target velocity directly and how advance_wp_along_track function will affect it), and what will be the cons of those change (on auto spline planning controller, since at times offset_scaler_oa can go to 0)
c) Hence I need some help in finding resources to understand AUTO controller’s implementation, suggest if there can be better ways to implement a simple stop in auto mode ( mostly velocity based control, because I want the system to be immune to false detections ), and may be point out the cons about the implementation I have done. (AC_WPNAV.cpp file attached for reference)
AC_WPNav.cpp (40.6 KB)
@rishabsingh3003 @Leonardthall @rmackay9 Need some help/suggestions if this will be the right direction