View Full Version : NaN_motion

08-27-2011, 11:05 PM
Having recently finished a very frustrating project (Win32 GUI (http://www.hospitalrecords.com/uploadimages/tonyfinger484.jpg)), I have spent the last bit fiddling around with the HaViMo2 vision modules we received a while ago and now I finally have something useful to post. The HaViMo2 are currently installed in little aluminum boxes mounted on pan-tilt turrets made of two AX-12+. The turrets are then mounted on Biped Walking Machines with each CM-510 mounted vertically over the battery on a pair of aluminum L-brackets to ensure sufficient clearance for the turret to rotate. The eventual goal is to enable students to play soccor/football with them. However, before the purchase was even made, I knew that just using the modules with RoboPlus Task to create useful programs would be an even bigger PITA than usual. As a very basic program to make the HaViMo2 capture an image and recover the color regions uses up many of the very limited number of available variables and code lines, even attempting to make the bot successfully play soccer against an opponent using only RoboPlus Task (until the programmers at Robotis see fit to add built in commands specifically for the HaViMo2) seems more than a little bit ridiculous (even more ridiculous than the length of this sentence). Unfortunately, as all of the robots in the lab are in Robotis designed configurations (CM-5 based Carbots, Gerwalks, and Humanoids, and CM-510 based Type-A Humanoids and Biped Walking Machines (http://support.robotis.com/en/product/bioloid/premiumkit/download/bio_prm_intermediate_apps.htm#9)), RoboPlus Motion files (and thus RoboPlus Task programs) are essential for using everything more complex than the carbot.

That is where this project comes in: yet another motion/pose interpolation engine (CM-5/510/700 and probably arbotiX compatible). Initially I was just going to modify the great lnxfergy's arbotiX 'BioloidController' to work on the CM-510, but I was not fond of the 'wiring.h' dependency and its resulting 'store some current value from a count, then after some indeterminate amount of time check to see if 32[ms] have passed' method of interpolating poses. So, what I hope to have ready for testing some time early this week is a new engine based on an ATmega1281/2561/644 counter whose vector points to a pose interpolation callback function. I have mostly finished a new dynamixel library that is hopefully a bit easier to use (with 'sync_write()' and 'sync_read()', and then other functions for the HaViMo2 to be added after basic library functionality is confirmed) and I should be thoroughly testing it on Monday. Once I have this portion of code in a less pitiful state, I will add it to this thread.

The first functional part of this project is the python script to convert Robotis Motion files (.mtn) to arbotiX 'BioloidController'-compatible header files. I say compatible, because it adds an additional 'pose' array which contains the IDs of the active servos in the motion file. This new array is identified within each motion sequence by the unused pointer in the first struct (of type 'transition_t') of the sequence's struct array (if that description makes any sense). This allows the use of arbitrary servo IDs instead of the 0 to N count of the 'BioloidController'. Since the Biped Walking Machine uses the same servo numbering scheme as the Type-A Humanoid (for the legs), this is a rather useful addition. The script can either add an ID array for each sequence, or save lots of memory by making only one ID array for an entire motion file (as each v1.01 motion file has only one line in it to identify the active servos in every motion page in the entire file). The script itself started out as a bash/sed script that worked surprisingly well, but eventually I realized 'yeah, that's really not very nice' and rewrote it in Python. I have very little experience with python, so there are likely several more errors/un-handled conditions that I have not found yet ('caveat emptor'). The site listed in the file is not up yet, but will be... eventually.

Oh yeah, on the project name... 'NaN' is the moniker I have been using pretty consistently on the Robotis QnA site, so I though it a suitable title. You may be a bit of a sad/pitiable person if you recognize where it comes from.
Also, I still am not entirely sure what I have or have not lost when my 10 year old laptop's hard drive decided it was finally time to take a dirt nap.

Not that anyone will really give a crap, but I encountered a bit of a delay by spending most of this week trying to fix an auto-login script for a javascript-based wifi network login page for the DARwIn (so a user does not have to remote connect over VNC to open firefox and manually enter the credentials).

08-27-2011, 11:55 PM
Cool. If you happen to look in trunk of our SVN repo (arbotix.googlecode.com) you'll find that the next generation of BioloidController library now stores arbitrary servo IDs, although I haven't yet updated PyPose and the associated sketch to handle it. The new library also allows you to instantiate multiple controllers, for instance a separate one for the head or an arm. Most of these updates were done to accommodate the current ROS drivers (which allow the creation of ROS trajectory controllers which fire up hardware interpolation for much closer to real-time control).


08-28-2011, 12:38 AM
Well crap... I had the feeling I should have dug a bit deeper. Thanks for giving me an excuse for abandoning yet another project part way through ;). Then again, I do still need to make a very simple to use HaViMo2 library if any of the supposed Computer Science Engineering students are going to use any of this (they seem to actually be afraid of C/C++, and have been sticking with just RoboPlus Task and maybe a little MATLAB).

08-28-2011, 01:27 AM
No, no, no! I didn't want you to abandon it! I was just letting you know that our core libraries would be usable with your scripts. I've actually had numerous requests for a way to convert .mtn files to our PyPose format, and I'm thrilled to see someone doing it. I'd like to see these scripts eventually included in our release if you're interested.


(and if you wonder why I edited your post, I accidently clicked "edit" instead of "reply to".... silly new forum interface)