dsNav
The software for Lino, as already explained, is very similar to Rino Code. The navigation software architecture is the same. The differences are due to the outdoor navigation requirements.
The table below shows how the different functions are executed and linked together with flags and global variables. They are started, as a very simple Cooperative Real Time Operating System, in the main loop by the flags set by timers and other functions, and executed in the lower possible time, to maintain the 1ms cycle.
Function | Activated by | Dependencies | Sets what ? | |
Pid1() / Pid2() | PIDx_CALC_FLAG | The flag is set in cycle 0 by TMR1, i.e.: every 1ms, and reset by PidxCalc() function if Vel < VEL_MIN_PID, the PID cycle is set to 10ms |
ISR _T1Interrupt(), Desired Speed for each single wheel set by Orientation() function | PWM duty cycle, SpTick[R], SpTick[L] |
DeadReckoning() | CYCLE1_FLAG | The flag is set in cycle 1 by TMR1, i.e.: every 10ms, and reset by DeadReckoning() function | ISR _T1Interrupt(), SpTick[R], SpTick[L] | X, Y current coordinates, Measured Theta, ORIENTATION_FLAG to start Orientation() function |
Orientation() | ORIENTATION_FLAG | The flag is set in DeadReckoning() after the position coordinates and current orientation have been computed | Desired Angle and Mean Speed set in Parser(), Measured Angle set in DeadReckoning() | Desired Speed for each single wheel |
Navigation() | CYCLE2_FLAG | The flag is set in cycle 2 by TMR1, i.e.: every 50ms, and reset by Navigation() function | ISR _T1Interrupt() | If the robot is close to the target, reduces the mean speed proportionally to the distance |
The orientation is computed with the aid of the IMU and the field mapping/obstacle avoidance is performed by the High Level Supervisor. Just the computation of the arguments highlighted in red differs between indoor and outdoor versions.
A graphical description of the procedures is visible on the block diagram to the right.
Further details on software can be found with the in-line comments and in the description file attached, everything available on Google Code.