To schedule regular maintenance we need to track the total amount of motion on each joint.
Possible method:
In DexRun.c,
new array joint_odo[NUM_JOINTS]
load joint_odo from odometer.txt on startup. e.g. setDefaults(DefaultMode);
in int MoveRobot( and int moveRobotPID(
Add abs(joint movement) to joint_odo
When socket closes close(connfd) and program end
Write joint_odo to odometer.txt
The closing of the socket seems like a good indication that the job is done and no more motion will happen for a while. Each job should run for at least several seconds, if not minutes, and so it shouldn't wear out the SD Card (?)
To schedule regular maintenance we need to track the total amount of motion on each joint.
Possible method:
In DexRun.c,
joint_odo[NUM_JOINTS]
setDefaults(DefaultMode);
int MoveRobot(
andint moveRobotPID(
close(connfd)
and program endThe closing of the socket seems like a good indication that the job is done and no more motion will happen for a while. Each job should run for at least several seconds, if not minutes, and so it shouldn't wear out the SD Card (?)