Legacy Forum: Preserving Nearly 20 Years of Community History - A Time Capsule of Discussions, Memories, and Shared Experiences.

libavr/libbioloid C library for CM5 released!

Bioloid robot kit from Korean company Robotis; CM5 controller block, AX12 servos..
289 postsPage 12 of 201 ... 9, 10, 11, 12, 13, 14, 15 ... 20
289 postsPage 12 of 201 ... 9, 10, 11, 12, 13, 14, 15 ... 20

Post by RandomMatt » Wed Jul 15, 2009 12:48 pm

Post by RandomMatt
Wed Jul 15, 2009 12:48 pm

http://robosavvy.com/forum/viewtopic.php?p=20378#20378

To paraphase: the problem is that I only want to publish part of a repo. git, like mercurial, isn't at all suited to that.
http://robosavvy.com/forum/viewtopic.php?p=20378#20378

To paraphase: the problem is that I only want to publish part of a repo. git, like mercurial, isn't at all suited to that.
RandomMatt
Savvy Roboteer
Savvy Roboteer
Posts: 117
Joined: Sat Dec 20, 2008 11:16 pm

Post by kamondelious » Wed Jul 15, 2009 1:33 pm

Post by kamondelious
Wed Jul 15, 2009 1:33 pm

Oh sorry, I didn't recall Mercurial was a version control system, just thought it was some big word (like so many others) I'd never heard of.

In which case, stick with what you like and keep up the great work.

I was mostly thinking along the lines that it's much easier to create/use/maintain a repo in GIT (and from what I see Mercurial) than in CVS/SVN and keeping libbioloid in it's own repo should be fairly easy. That said, I haven't really played with GIT as a remotely accessible repo and it would definitely be extra steps (albeit automateable) for you to publish.

The fact that you use version control for personal projects is commendable and everyone should be, as I am, just happy your work is freely available.

:D Cheers!
Oh sorry, I didn't recall Mercurial was a version control system, just thought it was some big word (like so many others) I'd never heard of.

In which case, stick with what you like and keep up the great work.

I was mostly thinking along the lines that it's much easier to create/use/maintain a repo in GIT (and from what I see Mercurial) than in CVS/SVN and keeping libbioloid in it's own repo should be fairly easy. That said, I haven't really played with GIT as a remotely accessible repo and it would definitely be extra steps (albeit automateable) for you to publish.

The fact that you use version control for personal projects is commendable and everyone should be, as I am, just happy your work is freely available.

:D Cheers!
kamondelious
Savvy Roboteer
Savvy Roboteer
Posts: 29
Joined: Tue Sep 30, 2008 11:18 pm

Increase clock speed

Post by tito_veneno » Wed Jul 29, 2009 11:02 pm

Post by tito_veneno
Wed Jul 29, 2009 11:02 pm

Hey guys!

I was just wondering how to increase the frequency of the clock. I know the default is 40 HZ but I need it to run at around 100 HZ.

I looked at the timer.h header file and timer.c but couldn't get the clock to speed up.

Thanks for your help!
Hey guys!

I was just wondering how to increase the frequency of the clock. I know the default is 40 HZ but I need it to run at around 100 HZ.

I looked at the timer.h header file and timer.c but couldn't get the clock to speed up.

Thanks for your help!
tito_veneno
Robot Builder
Robot Builder
Posts: 7
Joined: Thu May 07, 2009 11:17 pm

Post by kamondelious » Thu Jul 30, 2009 6:28 am

Post by kamondelious
Thu Jul 30, 2009 6:28 am

Hi tito_veneno!

Are you using the example.c that comes with libbioloid?

I believe you'll want to adjust the Makefile for your program to set the HZ value. Something like :
CFLAGS_AVR += -DHZ=100

Then check that the function timer_delay(HZ) is called in your while(1) loop to get it using the timing you specify.

Cheers!
Hi tito_veneno!

Are you using the example.c that comes with libbioloid?

I believe you'll want to adjust the Makefile for your program to set the HZ value. Something like :
CFLAGS_AVR += -DHZ=100

Then check that the function timer_delay(HZ) is called in your while(1) loop to get it using the timing you specify.

Cheers!
kamondelious
Savvy Roboteer
Savvy Roboteer
Posts: 29
Joined: Tue Sep 30, 2008 11:18 pm

Post by tito_veneno » Thu Jul 30, 2009 5:13 pm

Post by tito_veneno
Thu Jul 30, 2009 5:13 pm

Perfect! That worked!

Thanks a lot kamondelious!
Perfect! That worked!

Thanks a lot kamondelious!
tito_veneno
Robot Builder
Robot Builder
Posts: 7
Joined: Thu May 07, 2009 11:17 pm

Post by tito_veneno » Thu Jul 30, 2009 8:55 pm

Post by tito_veneno
Thu Jul 30, 2009 8:55 pm

Hey!

I now face a new problem. Right in the middle of running my program, the program crashes, and when I try to restart, it gives me the following error:

Code: Select all
7 (model mismatch): Model 0080


I then have to unplug the servos from the CM-5 to run it again.

I don't understand why it does this, since I'm using 7 of the same servo model (AX-12+), and that is the only one which is giving me a this error.

Does anyone know why this happens? Thanks
Hey!

I now face a new problem. Right in the middle of running my program, the program crashes, and when I try to restart, it gives me the following error:

Code: Select all
7 (model mismatch): Model 0080


I then have to unplug the servos from the CM-5 to run it again.

I don't understand why it does this, since I'm using 7 of the same servo model (AX-12+), and that is the only one which is giving me a this error.

Does anyone know why this happens? Thanks
tito_veneno
Robot Builder
Robot Builder
Posts: 7
Joined: Thu May 07, 2009 11:17 pm

Post by kamondelious » Fri Jul 31, 2009 1:00 am

Post by kamondelious
Fri Jul 31, 2009 1:00 am

Hey tito_veneno,

I've never seen/experienced that error, but for what you're doing to recover, it sounds like the servo is over heating and going into "lock" mode. The only way to "unlock" it is to power it off, which fits what you're saying.

Monitor the temp of your servos as your program runs and if/when the error happens again, cycle power on the CM5.

If you don't mind me asking, what are you building? :D

Cheers!
Hey tito_veneno,

I've never seen/experienced that error, but for what you're doing to recover, it sounds like the servo is over heating and going into "lock" mode. The only way to "unlock" it is to power it off, which fits what you're saying.

Monitor the temp of your servos as your program runs and if/when the error happens again, cycle power on the CM5.

If you don't mind me asking, what are you building? :D

Cheers!
kamondelious
Savvy Roboteer
Savvy Roboteer
Posts: 29
Joined: Tue Sep 30, 2008 11:18 pm

Post by BillB » Fri Jul 31, 2009 9:05 am

Post by BillB
Fri Jul 31, 2009 9:05 am

tito_veneno wrote:

I now face a new problem. Right in the middle of running my program, the program crashes, and when I try to restart, it gives me the following error:

Code:
7 (model mismatch): Model 0080


Ah that old chestnut! I battled with the same problem for a while.

It turned out to be a wiring problem. After a lot of wear use the socket of the servo became stretched so that the connection to the servo was intermittent. So , robot went through its motions it moved the wires enough to loose connection for long enough to cause problems.

The bioloid serial bus can be a sensitive to loose wires.


Incidentally the other instance where my libbioloid programs crash intermittently is when my code is too large (remember that you only have 4k to play with). So if all else fails try and slim down your code to the basics and see if you still have the problem.
tito_veneno wrote:

I now face a new problem. Right in the middle of running my program, the program crashes, and when I try to restart, it gives me the following error:

Code:
7 (model mismatch): Model 0080


Ah that old chestnut! I battled with the same problem for a while.

It turned out to be a wiring problem. After a lot of wear use the socket of the servo became stretched so that the connection to the servo was intermittent. So , robot went through its motions it moved the wires enough to loose connection for long enough to cause problems.

The bioloid serial bus can be a sensitive to loose wires.


Incidentally the other instance where my libbioloid programs crash intermittently is when my code is too large (remember that you only have 4k to play with). So if all else fails try and slim down your code to the basics and see if you still have the problem.
BillB
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 232
Joined: Sun Aug 06, 2006 1:00 am
Location: Hampshire, UK

Post by RandomMatt » Fri Jul 31, 2009 8:57 pm

Post by RandomMatt
Fri Jul 31, 2009 8:57 pm

kamondelious wrote:I believe you'll want to adjust the Makefile for your program to set the HZ value. Something like :
CFLAGS_AVR += -DHZ=100

Hmmm.... it seems that hiding the documentation in a Makefile wasn't the wisest of moves - I'll fix libbioloid.html.


BillB wrote:It turned out to be a wiring problem

Yes... that'd cause chaos. I should probably add that to the html as well - I'll just have to decide where!
kamondelious wrote:I believe you'll want to adjust the Makefile for your program to set the HZ value. Something like :
CFLAGS_AVR += -DHZ=100

Hmmm.... it seems that hiding the documentation in a Makefile wasn't the wisest of moves - I'll fix libbioloid.html.


BillB wrote:It turned out to be a wiring problem

Yes... that'd cause chaos. I should probably add that to the html as well - I'll just have to decide where!
RandomMatt
Savvy Roboteer
Savvy Roboteer
Posts: 117
Joined: Sat Dec 20, 2008 11:16 pm

Post by clusher » Wed Aug 05, 2009 5:16 pm

Post by clusher
Wed Aug 05, 2009 5:16 pm

Hey
After that small adventure with the servos, I decided that future C code implementations should be done with libbioloid. So here I am...
I'm still battling with the code (C isn't my mother language...) but I decided to start implementing some things.
I get an error when I compile example.c with the IMU active... I uncomment the
Code: Select all
{  120, MODEL_HUVIMU }

and
Code: Select all
dx_getimu(120, &imu);


and it says "undefined reference to dx_getimu"...
What am I doing wrong? :roll: again...

BTW: Why are all those %d when printing the IMU values? I only think of 6, 3 for the acellerometer and 3 for the gyro...
Hey
After that small adventure with the servos, I decided that future C code implementations should be done with libbioloid. So here I am...
I'm still battling with the code (C isn't my mother language...) but I decided to start implementing some things.
I get an error when I compile example.c with the IMU active... I uncomment the
Code: Select all
{  120, MODEL_HUVIMU }

and
Code: Select all
dx_getimu(120, &imu);


and it says "undefined reference to dx_getimu"...
What am I doing wrong? :roll: again...

BTW: Why are all those %d when printing the IMU values? I only think of 6, 3 for the acellerometer and 3 for the gyro...
clusher
Savvy Roboteer
Savvy Roboteer
Posts: 57
Joined: Thu Jul 17, 2008 12:27 pm

Post by RandomMatt » Thu Aug 06, 2009 8:43 am

Post by RandomMatt
Thu Aug 06, 2009 8:43 am

clusher wrote:it says "undefined reference to dx_getimu"...
What am I doing wrong? :roll: again...


Nothing... It is my fault - we have a case of bit rot. At some point in the past I renamed dx_getimu() to dx_get_huv_imu(), but forgot about example.c.


clusher wrote:BTW: Why are all those %d when printing the IMU values? I only think of 6, 3 for the acellerometer and 3 for the gyro...


Good question... it is clearly wrong, I'll blame StuartL and fix that to.
clusher wrote:it says "undefined reference to dx_getimu"...
What am I doing wrong? :roll: again...


Nothing... It is my fault - we have a case of bit rot. At some point in the past I renamed dx_getimu() to dx_get_huv_imu(), but forgot about example.c.


clusher wrote:BTW: Why are all those %d when printing the IMU values? I only think of 6, 3 for the acellerometer and 3 for the gyro...


Good question... it is clearly wrong, I'll blame StuartL and fix that to.
RandomMatt
Savvy Roboteer
Savvy Roboteer
Posts: 117
Joined: Sat Dec 20, 2008 11:16 pm

HaViMo

Post by kamondelious » Wed Sep 09, 2009 2:01 pm

Post by kamondelious
Wed Sep 09, 2009 2:01 pm

Good day!

Has anyone with a HaViMo been able to make it work using libbioloid?

I've been trying out RandomMatt's suggestion from earlier in this thread about using dx_read & dx_write to write my own helper function.

I'm only trying to grab images at this point so I've only been using dx_read.

The problem is that dx_read uses INST_READ (value of 0x02) as the instruction for the packet and the HaViMo requires 0x0C as noted in
http://robosavvy.com/forum/viewtopic.php?t=1341&postdays=0&postorder=asc&start=120
Which means I have to build my own packet, so I copied dx_read and named it havimo_read passing in the packet array as opposed to how it's defined in dx_read.

This isn't working for me and I'm not sure what I'm doing wrong just yet, so I figured I'd ask and see if anyone has made this work already and could give me some tips.

Cheers!
Good day!

Has anyone with a HaViMo been able to make it work using libbioloid?

I've been trying out RandomMatt's suggestion from earlier in this thread about using dx_read & dx_write to write my own helper function.

I'm only trying to grab images at this point so I've only been using dx_read.

The problem is that dx_read uses INST_READ (value of 0x02) as the instruction for the packet and the HaViMo requires 0x0C as noted in
http://robosavvy.com/forum/viewtopic.php?t=1341&postdays=0&postorder=asc&start=120
Which means I have to build my own packet, so I copied dx_read and named it havimo_read passing in the packet array as opposed to how it's defined in dx_read.

This isn't working for me and I'm not sure what I'm doing wrong just yet, so I figured I'd ask and see if anyone has made this work already and could give me some tips.

Cheers!
kamondelious
Savvy Roboteer
Savvy Roboteer
Posts: 29
Joined: Tue Sep 30, 2008 11:18 pm

Post by kamondelious » Thu Sep 10, 2009 6:04 pm

Post by kamondelious
Thu Sep 10, 2009 6:04 pm

Seems like I'm making some progress.

To do an image capture I need to be sending 0x0E (capture) as the instruction part of the packet as opposed to a read/write instruction and it doesn't send a return packet. This was causing some issues/confusion for me. The dx_write function I based my function off of expects a return packet.

dx_ping doesn't seem to be working with it so my code for actually reading the image data never runs.

I'm going to try grabbing a raw sample and see if that works. If not I'm going to go back to the calibration app and ensure that things still work.
Seems like I'm making some progress.

To do an image capture I need to be sending 0x0E (capture) as the instruction part of the packet as opposed to a read/write instruction and it doesn't send a return packet. This was causing some issues/confusion for me. The dx_write function I based my function off of expects a return packet.

dx_ping doesn't seem to be working with it so my code for actually reading the image data never runs.

I'm going to try grabbing a raw sample and see if that works. If not I'm going to go back to the calibration app and ensure that things still work.
kamondelious
Savvy Roboteer
Savvy Roboteer
Posts: 29
Joined: Tue Sep 30, 2008 11:18 pm

Post by hamid_m » Thu Sep 10, 2009 7:08 pm

Post by hamid_m
Thu Sep 10, 2009 7:08 pm

Hi Everybody,

I have been informed by Stuart, that you try to include HaViMo in libbioloidC.
So I am ready to answer any questions you may have around HaViMo.

something that may help for sure is an example program I have posted in my Topic:
http://robosavvy.com/site/Builders/hamid_m/example.c

So don't hesitate to ask your questions.

Best regards,
Hamid.
Hi Everybody,

I have been informed by Stuart, that you try to include HaViMo in libbioloidC.
So I am ready to answer any questions you may have around HaViMo.

something that may help for sure is an example program I have posted in my Topic:
http://robosavvy.com/site/Builders/hamid_m/example.c

So don't hesitate to ask your questions.

Best regards,
Hamid.
hamid_m
Savvy Roboteer
Savvy Roboteer
Posts: 133
Joined: Thu May 03, 2007 4:56 pm

Post by kamondelious » Sun Sep 13, 2009 4:55 am

Post by kamondelious
Sun Sep 13, 2009 4:55 am

Well, thanks to Hamid's instructions I overcame an issue with not being able to get data from the vision module. :D Thanks again Hamid!

dx_ping doesn't work and I don't understand why yet.

I had discovered Hamid's example.c a little while ago, but I'm definitely struggling a bit with mentally juggling between the two approaches for bus communication. :? Curse my n00bness! I mean, conceptually it seems fairly straight forward, send the instruction packet, with or without data, and depending on what you've sent, you receive return packet(s).

I think I have the raw sample "working", it just takes a really long time. More than several minutes, so I'm definitely doing something wrong. I seem to recall reading in the documentation on this saying it is slow (4-5s).

I'm going to reread through the HaViMo thread and probably ask some vision module specific questions there.
Well, thanks to Hamid's instructions I overcame an issue with not being able to get data from the vision module. :D Thanks again Hamid!

dx_ping doesn't work and I don't understand why yet.

I had discovered Hamid's example.c a little while ago, but I'm definitely struggling a bit with mentally juggling between the two approaches for bus communication. :? Curse my n00bness! I mean, conceptually it seems fairly straight forward, send the instruction packet, with or without data, and depending on what you've sent, you receive return packet(s).

I think I have the raw sample "working", it just takes a really long time. More than several minutes, so I'm definitely doing something wrong. I seem to recall reading in the documentation on this saying it is slow (4-5s).

I'm going to reread through the HaViMo thread and probably ask some vision module specific questions there.
kamondelious
Savvy Roboteer
Savvy Roboteer
Posts: 29
Joined: Tue Sep 30, 2008 11:18 pm

PreviousNext
289 postsPage 12 of 201 ... 9, 10, 11, 12, 13, 14, 15 ... 20
289 postsPage 12 of 201 ... 9, 10, 11, 12, 13, 14, 15 ... 20