Custom function to test waypoints.

This commit is contained in:
vivek-shankar 2018-08-31 19:59:14 -04:00
parent c41bb81763
commit 0647601086
1 changed files with 9 additions and 0 deletions

View File

@ -31,6 +31,15 @@ function idle() {
function cusfun(){
BVMSTATE="CUSFUN"
log("cusfun: yay!!!")
LOCAL_TARGET = math.vec2.new(5 ,0 )
local_set_point = math.vec2.new(LOCAL_TARGET.x - pose.position.x ,LOCAL_TARGET.y - pose.position.y ) # has to move 5 meters in x from the home location
if(math.vec2.length(local_set_point) > GOTODIST_TOL){
local_set_point = LimitSpeed(local_set_point, 1.0)
goto_abs(local_set_point.x, local_set_point.y, 0.0, 0.0)
}
else{
log("TARGET REACHED")
}
}
function launch() {