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

Editing motion files by hand or programmically

Bioloid robot kit from Korean company Robotis; CM5 controller block, AX12 servos..
5 postsPage 1 of 1
5 postsPage 1 of 1

Editing motion files by hand or programmically

Post by Frankfurter » Tue May 03, 2011 1:28 pm

Post by Frankfurter
Tue May 03, 2011 1:28 pm

Hi everybody!

I'm currently working with a Bioloid Premium Kit for a Project.
For this I generate a series of angular coordinates in Matlab and send them to the Robot via the USB2Dynamixel interface.
It would be hugely useful if I could somehow export these trajectories into a .mtn file and upload it to the 'bot.
I looked at one of the example files and they seem to be pretty straight forward / plain text.
However I can not seem to get RoboPlus Motion to accept a file I modified, it shows an error "This is not [a] RoboPlus Motion file!"
Even if I just edit one single value and leave the rest of the file intact...
Are the files somehow tagged to prevent tampering?

I hope You can clear this up for me.
Hi everybody!

I'm currently working with a Bioloid Premium Kit for a Project.
For this I generate a series of angular coordinates in Matlab and send them to the Robot via the USB2Dynamixel interface.
It would be hugely useful if I could somehow export these trajectories into a .mtn file and upload it to the 'bot.
I looked at one of the example files and they seem to be pretty straight forward / plain text.
However I can not seem to get RoboPlus Motion to accept a file I modified, it shows an error "This is not [a] RoboPlus Motion file!"
Even if I just edit one single value and leave the rest of the file intact...
Are the files somehow tagged to prevent tampering?

I hope You can clear this up for me.
Frankfurter
Newbie
Newbie
Posts: 2
Joined: Tue May 03, 2011 1:22 pm

Post by Fritzoid » Tue May 03, 2011 3:45 pm

Post by Fritzoid
Tue May 03, 2011 3:45 pm

Hi Frankfurter,

If that's your real name :wink:

Motion files are a strange mixture of ASCII and binary. The first three bytes in the file are a fixed binary marker, 0xEFBBBF. The last two bytes are a binary checksum. It's these two bytes that are probably tripping you up. If you change anything in the file you will have to recalculate the checksum.

To calculate the checksum you must add-up all the bytes in the file individually then subtract the total from -1 and store the low order two bytes at the end of the file. I think the high byte goes first. I have some sample code if you need it.
Hi Frankfurter,

If that's your real name :wink:

Motion files are a strange mixture of ASCII and binary. The first three bytes in the file are a fixed binary marker, 0xEFBBBF. The last two bytes are a binary checksum. It's these two bytes that are probably tripping you up. If you change anything in the file you will have to recalculate the checksum.

To calculate the checksum you must add-up all the bytes in the file individually then subtract the total from -1 and store the low order two bytes at the end of the file. I think the high byte goes first. I have some sample code if you need it.
Fritzoid
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 331
Joined: Mon Dec 18, 2006 1:00 am

Post by Frankfurter » Wed May 04, 2011 10:05 am

Post by Frankfurter
Wed May 04, 2011 10:05 am

Thanks for your reply.
I almost suspected that those strange two bytes at the end could be some kind of checksum. I only looked at one example file so I didn't notice...
I opened the files in Notepad++ and don't see the marker at the beginning but if you say it's there I'll trust you. Writing it from a program is not an issue anyway.
Some sample code to get me started would be awesome. :)
Thanks for your reply.
I almost suspected that those strange two bytes at the end could be some kind of checksum. I only looked at one example file so I didn't notice...
I opened the files in Notepad++ and don't see the marker at the beginning but if you say it's there I'll trust you. Writing it from a program is not an issue anyway.
Some sample code to get me started would be awesome. :)
Frankfurter
Newbie
Newbie
Posts: 2
Joined: Tue May 03, 2011 1:22 pm

Post by Fritzoid » Wed May 04, 2011 6:09 pm

Post by Fritzoid
Wed May 04, 2011 6:09 pm

Take a look at http://robosavvy.com/Builders/Fritzoid/MotionEdit.zip

This file contains a netbeans project, written in java, that can read and write motion files. It also has upload and download functions, but so far they only work with Darwin-OP. The code is a work-in-progress so there are a lot of missing pieces like a cell editor and play capability. Nevertheless it has already been useful to me.

The functionality that you are looking for can be found in MotionEdit/src/motionedit/MotionEditApp.java
Take a look at http://robosavvy.com/Builders/Fritzoid/MotionEdit.zip

This file contains a netbeans project, written in java, that can read and write motion files. It also has upload and download functions, but so far they only work with Darwin-OP. The code is a work-in-progress so there are a lot of missing pieces like a cell editor and play capability. Nevertheless it has already been useful to me.

The functionality that you are looking for can be found in MotionEdit/src/motionedit/MotionEditApp.java
Fritzoid
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 331
Joined: Mon Dec 18, 2006 1:00 am

Post by excalibur » Wed May 11, 2011 12:03 am

Post by excalibur
Wed May 11, 2011 12:03 am

ThanQ Fritzoid
Your answers were very useful for me too.
ThanQ Fritzoid
Your answers were very useful for me too.
excalibur
Robot Builder
Robot Builder
Posts: 17
Joined: Mon Mar 28, 2011 1:05 pm


5 postsPage 1 of 1
5 postsPage 1 of 1