Algorithm to route a robot based into a Compass
$10-30 USD
Pago na entrega
I need help into a algorithm to turn a robot left (CCW and stop if compass<= target) or right (CW and stop if compass>= target). The problem is on the zero cross (when the countin pass from 359 to 0 or the opposite), example, I need to turn a robot left 30CCW, and I am into 10. So I need to turn left untill compass<= target, so 340, but see: the position I'm already is compass<= target. THIS IS THE GOAL, fix this.
Below is the resume of the function:
void routingPathC(int targetC, int compass)
{
if (routePathCompassStart == false)
{
routePathCompassStart = false;
routingPathCompass = true;
cw = false;
ccw = false;
degreesC = 0;
// HERE I CALCULATE THE CW AND CCW and set or not ccw, cw and put the value on degrees.
}
if (routingPathCompass == true)
{
// HERE I PUT THE MOVEMENT FUNCTION
}
}
- PLEASE DO NOT PLACE A BID BIGGER THAN MY BUDGET, I'M NOT HIRE YOU, SO DO NOT MESS.
- I NEED IT IN 1h
ID do Projeto: #8950445
Sobre o projeto
Concedido a:
can do it,especially c++ programming,I have also knowledge about microcontrollers,I have my own robot,so it will be easy to help you