Software > Software

webbotlibs gait designer

<< < (2/2)

RifRaf:
hi Webbot, firstly thanks for some great libraries, lost interest with robots a few years back due to not being able to code well and returned to find these great libs, and going to learn to code this time too.

It appears the DRIVE_SPEED parameter is for gaitrunner and currently am limited to gait designer, the pc interface, as the code will not compile for gait runner (have posted this already in another thread so won't go on too much) have used all the default settings and not modified the exported gait file. 

Things will be much better when gait runner can be used standalone on the avr, looking forward to being able to call individual gaits and use them with input from sensors.  If you or anyone would have a working example of code that compiles with gait runner and the gait file should be able to see what I am doing wrong. 

Will have another go now and see how it goes

the current code that is not compiling


--- Code: ---#include "hardware.h"
#include "sweep.h" //exported file from gait designer, is read only and have not modified
#include <Gait/GaitRunner.h>

ACTUATOR_LIST PROGMEM all[] = {&_servo1_.actuator,&_servo2_.actuator,&_servo3_.actuator,&_servo4_.actuator,&_servo5_.actuator,&_servo6_.actuator,&_servo7_.actuator };

//The first parameter is the ACTUATOR_LIST containing all of the servos you want to control.
//The second parameter is the list of possible animations in the gait file exported from Gait Designer. This is called 'animations' - unless you have modified the file by hand.
G8_RUNNER gait = MAKE_G8_RUNNER(all, animations);

void appInitHardware(void) {
gaitRunnerInit(&gait);
initHardware();
}

TICK_COUNT appInitSoftware(TICK_COUNT loopStart){
    //gaitRunnerPlay(G8_RUNNER* runner, uint8_t animation, int16_t loopSpeed, DRIVE_SPEED speed, int16_t repeatCount
gaitRunnerPlay(&gait, 0, 1000, 100, 10);
return 0;
}

TICK_COUNT appControl(LOOP_COUNT loopCount, TICK_COUNT loopStart) {
gaitRunnerProcess(&gait);
return 0;
}

--- End code ---

with the errors..
MT gait.o -MF dep/gait.o.d -fno-threadsafe-statics -O0 -c -o gait.o gait.cpp
sweep.h:47: error: animations causes a section type conflict
sweep.h:43: error: frames_0 causes a section type conflict
sweep.h:21: error: limbs_0_0 causes a section type conflict
sweep.h:32: error: limbs_0_1 causes a section type conflict
make: *** [gait.o] Error 1

line 47 of sweep.h is..

--- Code: ---const PROGMEM G8_ANIMATION PROGMEM animations[1] = {


--- End code ---

RifRaf:
Made progress, after generating from project manager as C rather than C++ everything working and animation playing standalone, used the same code basically and had to rename the servos back from _servo1_ to just servo1 . so can only imagine there might be an issue when generating as C++ . for now can continue to make progress though, cheers.

Gertlex:
I too have had lesser success with the gait tools in C++, but have been satisfied working in C.

Webbot:
Gertlex beat me to it - but the GaitDesigner was originally written when WebbotLib only supported C. I never got around to modifying it for C++ syntax.
The underscores you need to add in C++ are to access the 'C version' of the servo from your C++, hence when generating for just C you don't need to have them.
The other C++ issues to do with 'section type conflict' are a very bizarre problem caused by the C++ compiler.
I will get around to fixing it at some time - but am still working on WebbotLibStudio which initially will ignore all the gait stuff (as its not used as much as everything else), but eventually the GaitDesigner will become an integral part of WebbotLibStudio which only generates C++ and so will require me to sort out the issues anyway.

But in the meantime - enjoy it in 'C' !

Navigation

[0] Message Index

[*] Previous page

Go to full version