shyu1 wrote:i'm using cygwin on a windows machine.
any help would be greatly appreciated. i only have a year or so of experience in C and linux so i apologize for any stupid mistakes i make.
RandomMatt wrote:Just have a look in supervisor.c - adding -DNO_SUPERVISOR to your CFLAGS_AVR will do it. It will also remove the auto locking of servos - if you need that (and I think that you probably want it) - add dx_initrobot(&robot); to supervisor_init(): line 20ish.
shyu1 wrote:hey i'm an undergrad working on the bioloids in a lab. i'm having trouble running the example.c stuff from the first page of this topic.
i downloaded everything to the best of my knowledge. However, in the example directory, when i type make i get an error that trig tables can't be found.
following the advice given, i tried to use a manual compile with the gcc -o command however, i still got an error saying that there is no such file or folder as trig_tables.c.
i'm using cygwin on a windows machine.
any help would be greatly appreciated. i only have a year or so of experience in C and linux so i apologize for any stupid mistakes i make.
thanks.
RandomMatt wrote:buhochileno wrote:ok man, it was just a question...
True... and there is no harm in asking
When I decided to publish libbioloid, I did look at how to allow access to a repository - and it seems that the version control boys have not solved this particular problem (*).
* the problem is having some files that are private in a public repository.
--
You can always use wget or curl to get the tgz - in which case you'll only have a problem when I remove a file.
buhochileno wrote:and..by the way, what is the C standard used by the avr?, I mean I probably can't do a "fork" or pthread, so what are the boundries?
shyu1 wrote:thanks for the quick responses.
I did install c, c++ and java compilers under the devel package when installing cygwin. however, when i try using the manual compile with the "gcc -o..." line it says that the files or folders do not exist.
i'll try writing a hello world program and seeing if cygwin compiles it.
i'm pretty sure i untarred(?) the two tgz files in the same directory. but buchileno, you mention three files. i was under the impression we only needed to download two.
thanks again for all your help.
shyu1 wrote:so the hello world program compiles and executes fine.
my tree is like this:
c/Bioloid
--->libavr
--->LICENSE libavr stind.h
--->libbioloid
--->LICENSE bioloid
both the libavr and libbioloid folders are under the Bioloid folder. there's a few other folders there such as the example folder.
StuartL wrote:buhochileno wrote:and..by the way, what is the C standard used by the avr?, I mean I probably can't do a "fork" or pthread, so what are the boundries?
There are NO standard libraries in libbioloid. There's no implementation of fork(), select(), fopen() etc. Some of these could be implemented if you could think of a practical use but the AVR only runs at 16MHz and your idea of modern multitasking OSs will have to take a twenty year regression if you want to start multi-tasking
The most effective (or maybe easiest) way to use libbioloid is to write a simple linear programme that waits when it needs to wait (by looping etc) and sends commands when it needs to send commands. The interrupt handlers inside libbioloid will handle all the serial comms, retransmits, timers etc.
You could do more and implement your own timers and interrupts but you MUST be careful of interrupt priorities. The bus code is very time sensitive as you don't get many cycles to read incoming bytes by the time the interrupt overhead occurs.
buhochileno wrote:how to setup a servo to do endless turns (wheel) with libbioloid?
If both values for the CW Angle Limit and the CCW Angle Limit are set to 0, an Endless Turn mode can be implemented by setting the Goal Speed.
dx_set_minmax_angle(id, SERVO_MIN, SERVO_MIN);
dx_set_speed(id, speed);
RandomMatt wrote:buhochileno wrote:how to setup a servo to do endless turns (wheel) with libbioloid?
You need to read the AX12 manual... page 17 says:If both values for the CW Angle Limit and the CCW Angle Limit are set to 0, an Endless Turn mode can be implemented by setting the Goal Speed.
so...
- Code: Select all
dx_set_minmax_angle(id, SERVO_MIN, SERVO_MIN);
dx_set_speed(id, speed);
buhochileno wrote:yeap I read it, so I going something wrong...:
...
case 'y': //enable endless turn (wheel)
dx_set_minmax_angle(101, SERVO_MIN, SERVO_MIN);
dx_set_speed(101, 100);
break;
case 'h': //disable endless turn (wheel)
dx_set_minmax_angle(101, SERVO_MIN, SERVO_MAX);
//dx_set_speed(101, 100);
break;
RandomMatt wrote:buhochileno wrote:yeap I read it, so I going something wrong...:
...
case 'y': //enable endless turn (wheel)
dx_set_minmax_angle(101, SERVO_MIN, SERVO_MIN);
dx_set_speed(101, 100);
break;
case 'h': //disable endless turn (wheel)
dx_set_minmax_angle(101, SERVO_MIN, SERVO_MAX);
//dx_set_speed(101, 100);
break;
Whoops... my mistake. I should have thought more about what happens when...
When the supervisor initialises the robot it sends the min/max angles from the robot structure to the servo - and then it locks the servo - preventing any update to them.
So:* if you want some servos in endless turn mode all the time, and other servos not in endless turn mode all the time - its easy
* if you want ot do other stuff, you'll have to disable the supervisor by adding "-DNO_SUPERVISOR -DNO_SUPERVISOR_INITROBOT" to your CFLAGS_AVR. I think your code will then work.