PDA

View Full Version : [Question(s)] Hexapod_Mark_II software won't compile



docbill
11-11-2016, 07:26 PM
While I am not newbie to robots, I am a newbie to the phantomX markIII. I have had problems compiling the demo software. I would like to get it running before I dive into coding. This is the error I am getting:

Arduino: 1.6.9 (Windows 10), Board: "ArbotiX Std"
In file included from sketch\nuke.cpp:64:0:
sketch\gaits.h: In function 'ik_req_t SmoothGaitGen(int)':
gaits.h:105: error: unable to find a register to spill in class 'POINTER_REGS'
}
^
gaits.h:105: error: this is the insn:
(insn 489 488 490 27 (set (reg:HI 26 r26)
(reg/f:HI 134 [ .result_ptr ])) sketch\gaits.h:104 82 {*movhi}
(nil))
sketch\gaits.h:105: confused by earlier errors, bailing out
exit status 1
unable to find a register to spill in class 'POINTER_REGS'
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Any suggestions??
Thanks

KurtEck
11-12-2016, 05:44 PM
It might help to know where you installed the Arbotix libraries and Nuke from.

Several months ago. Kyle Granat at Trossen was (finally) moving the Trossen code base away from Arduino 1.0.5 to the more current releases like 1.6.12, using my Fork/Branch of the stuff. The last message I received was back in late July that he was close, but there were some issues with some MX servos (also his last posting on forum was on 8/10)...

Details about the update are up in the thread: http://forums.trossenrobotics.com/showthread.php?7971-ArbotiX-1-6-Files-Libraries

Not sure of the status of Nuke, with the build. I typically did not use NUKE, but I know at one point I did verify I had a buildable version of it.

docbill
11-13-2016, 05:36 PM
Thanks, In all the time I've been programming arduinos, I've never seen that error. Perhaps going to an older version of the ide would help?
As for NUKE, even that has a bug in it! There was a line about Nullcolor, if I remember correctly, that I had to comment out to get it to run. Since the robots have been around for a while, I did not expect to see the code this buggy.

KurtEck
11-14-2016, 12:12 PM
As I mentioned, not sure if/who is doing anything these days with this code...

I see on my machine that this compiler issue was found (maybe by me) for awhile. I have an extracted version called Compile_error dated 11/11/2015.

The code has two versions of that function. The original that the compiler choked on and another version which compiles...



#ifdef COMPILER_FAILS
/* Smoother, slower gait. Legs will make a arc stroke. */
ik_req_t SmoothGaitGen(int leg){
if( MOVING ){
// are we moving?
if(step == gaitLegNo[leg]){
// leg up, halfway to middle
gaits[leg].x = gaits[leg].x/2;
gaits[leg].y = gaits[leg].y/2;
gaits[leg].z = -liftHeight/2;
gaits[leg].r = gaits[leg].r/2;
}else if((step == gaitLegNo[leg]+1) && (gaits[leg].z < 0)){
// leg up position
gaits[leg].x = 0;
gaits[leg].y = 0;
gaits[leg].z = -liftHeight;
gaits[leg].r = 0;
}else if((step == gaitLegNo[leg] + 2) && (gaits[leg].z < 0)){
// leg halfway down
gaits[leg].x = (Xspeed*cycleTime*pushSteps)/(4*stepsInCycle);
gaits[leg].y = (Yspeed*cycleTime*pushSteps)/(4*stepsInCycle);
gaits[leg].z = -liftHeight/2;
gaits[leg].r = (Rspeed*cycleTime*pushSteps)/(4*stepsInCycle);
}else if((step == gaitLegNo[leg]+3) && (gaits[leg].z < 0)){
// leg down position NOTE: dutyFactor = pushSteps/StepsInCycle
gaits[leg].x = (Xspeed*cycleTime*pushSteps)/(2*stepsInCycle); // travel/Cycle = speed*cycleTime
gaits[leg].y = (Yspeed*cycleTime*pushSteps)/(2*stepsInCycle); // Stride = travel/Cycle * dutyFactor
gaits[leg].z = 0; // = speed*cycleTime*pushSteps/stepsInCycle
gaits[leg].r = (Rspeed*cycleTime*pushSteps)/(2*stepsInCycle); // we move Stride/2 here
}else{
// move body forward
gaits[leg].x = gaits[leg].x - (Xspeed*cycleTime)/stepsInCycle; // note calculations for Stride above
gaits[leg].y = gaits[leg].y - (Yspeed*cycleTime)/stepsInCycle; // we have to move Stride/pushSteps here
gaits[leg].z = 0; // = speed*cycleTime*pushSteps/stepsInCycle*pushSteps
gaits[leg].r = gaits[leg].r - (Rspeed*cycleTime)/stepsInCycle; // = speed*cycleTime/stepsInCycle
}
}else{ // stopped
gaits[leg].z = 0;
}
return gaits[leg];

#else
// Hacked up version, that keeps a local copy of the index that is being updated, that
// compiles.
ik_req_t SmoothGaitGen(int leg){
ik_req_t gait_leg = gaits[leg];
if( MOVING ){
// are we moving?
if(step == gaitLegNo[leg]){
// leg up, halfway to middle
gait_leg.x = gait_leg.x/2;
gait_leg.y = gait_leg.y/2;
gait_leg.z = -liftHeight/2;
gait_leg.r = gait_leg.r/2;
}else if((step == gaitLegNo[leg]+1) && (gait_leg.z < 0)){
// leg up position
gait_leg.x = 0;
gait_leg.y = 0;
gait_leg.z = -liftHeight;
gait_leg.r = 0;
}else if((step == gaitLegNo[leg] + 2) && (gait_leg.z < 0)){
// leg halfway down
gait_leg.x = (Xspeed*cycleTime*pushSteps)/(4*stepsInCycle);
gait_leg.y = (Yspeed*cycleTime*pushSteps)/(4*stepsInCycle);
gait_leg.z = -liftHeight/2;
gait_leg.r = (Rspeed*cycleTime*pushSteps)/(4*stepsInCycle);
}else if((step == gaitLegNo[leg]+3) && (gait_leg.z < 0)){
// leg down position NOTE: dutyFactor = pushSteps/StepsInCycle
gait_leg.x = (Xspeed*cycleTime*pushSteps)/(2*stepsInCycle); // travel/Cycle = speed*cycleTime
gait_leg.y = (Yspeed*cycleTime*pushSteps)/(2*stepsInCycle); // Stride = travel/Cycle * dutyFactor
gait_leg.z = 0; // = speed*cycleTime*pushSteps/stepsInCycle
gait_leg.r = (Rspeed*cycleTime*pushSteps)/(2*stepsInCycle); // we move Stride/2 here
}else{
// move body forward
gait_leg.x = gait_leg.x - (Xspeed*cycleTime)/stepsInCycle; // note calculations for Stride above
gait_leg.y = gait_leg.y - (Yspeed*cycleTime)/stepsInCycle; // we have to move Stride/pushSteps here
gait_leg.z = 0; // = speed*cycleTime*pushSteps/stepsInCycle*pushSteps
gait_leg.r = gait_leg.r - (Rspeed*cycleTime)/stepsInCycle; // = speed*cycleTime/stepsInCycle
}
}else{ // stopped
gait_leg.z = 0;
}
gaits[leg] = gait_leg;
return gait_leg;
}
#endif

But again I don't know if anyone is maintaining this code.

Kurt

docbill
11-14-2016, 05:49 PM
Kurt,
I thought about what you said and went back and loaded the pre 1.6 update code and the 1.03 Arduino ide. The original code compiles now although I think it is still buggy as the robot halts for no reason and then refuses to answer command. It takes 1 or more on-off cycles to get it back, but at least I have a version that loads. Now I can hack it to work properly:cool:. It goes on my todo list as I was working on another hexapod (a hexy) when the phantom x arrived. I have not looked at it yet, but is NUKE a generic program or does it only work with the phantom? I am writing the code for hexy from scratch, but I wouldn't mind a short cut for the motion routines.
DocBill

KurtEck
11-14-2016, 06:19 PM
For me I sort of refused to go back to the older Arduino 1.0.x and the Arbotix hardware stuff, which was a cross of older Arduino versions...

I have not used NUKE stuff since about the first day I receive my PhantomX MK1, after that point I ported the Phoenix code base over to run on it... Several versions of it out there including: https://github.com/KurtE/Phantom_Phoenix