Alternate Kaya driver

Hey, folks!

I’ve been working on an alternate implementation of isaac::KayaBaseDriver. I’ve got a basic dynamixel control library and 3-wheel holonomic kinematics working for the Kaya. It’s definitely immature and has a few caveats at the moment:

  • The state message sent doesn't populate correct values for everything (position, acceleration)
  • The dynamixel motor control is very basic. The error handling is not great, but the debug mode does show you what failed and for which motor.
  • Though I am a software engineer, this is my first real C++ project as well as my first kinematic model, so, I'm sure there's much that I could be doing better here.

Going through this process has been extremely educational for me and the alternate driver component allows me to debug things that I can’t with the default driver. At the moment, it works pretty well, but I will continue to improve it (next up is better motor control error handling).

I will be stalled on this project for a while as I’ll be out of town for the next week. I also had a little accident with my Kaya last night. When I’m working on the code, I often have the Kaya sitting with its battery on top of something so that the wheels can spin freely. I got back from a walk last night and forgot that I hadn’t put the box under it before I tested something, and it took a nose dive from a few feet in the air. As a result, one of the motors is now having serious issues -__- I’ll get a new one ordered and hopefully will be back to work on this in another week.

I’ll add some documentation later, but you can use it just like you’re used to. The .deploy.sh script is the same as in the velodyne-lidar repo. The app JSON can be edited as normal, but I wasn’t able to figure out how to reference the app JSON from the Isaac SDK, so I’ve copied those to this repo (with some changes for my purposes, but you can replace with your own). As you can see in the config in this project, you’ll reference this component with a slightly different name (isaac::kaya::BaseDriver rather than isaac::KayaBaseDriver).

I’m sharing this because I know that others have had issues with the kaya driver and have been looking for code. I’d definitely appreciate any feedback or contributions! I’m also looking forward to NVIDIA releasing their code so that I can compare it with what I’ve done. I hope that this is interesting or useful to others.

Anyhow, here’s the repo: https://github.com/bluecamel/isaac-kaya

Oh, also, another future goal is to extend the dynamixel library to support other models of motors. I think it would be possible to figure out which model is connected and load the control table for that model, but I’ve just focused on the MX-12W for now. Though, it shouldn’t be hard for others to add their own control table/values and use other motors.

I was also very curious about the code for the KayaBaseDriver. I’m very excited that someone has tried to make a driver that we can actually interface with!

Also, I’m trying to understand your current setup for your base driver, this is what would be deployed on the Kaya itself, because your project directories look very similar to that.

Per your instructions and I am still a bit confused on how to use the driver in our own apps. For instance, I would like to incorporate your driver into my current app so I can control the dynamixel motors.

Anyway, thanks for this and I hope everything goes well with replacing your motor!

So sorry for the delay. I finally got time to write some documentation. Please see the updated README for usage instructions and component API and let me know if something doesn’t make sense.

I’ve also added acceleration to the state message. I did it in a very simple, and maybe naive way, by simply calculating the difference between the previous to current velocities over that period of time.

An interesting note is that when I use the default driver and receive its state messages, accelerations are always 0.

Hey, folks. I’ve just pushed a lot of updates to the driver. It now provides all of the features of the original (except for debug_mode wheel speeds), including some extras, like publishing the command and state messages to sight.

Channels are awesome, but took me way too long to figure out, as they aren’t really documented. It’s really pretty simple, but without docs, I thought channels were just the messages being passed, but couldn’t understand why the channels showing up were different from the messages. I finally read through the codelet code and saw that channels are updated explicitly with show ([url]https://github.com/bluecamel/isaac-kaya/blob/master/packages/kaya/components/BaseDriver.cpp#L110[/url]).

It’s really nice to have all of that information in sight!

External Media

This lets you see a lot of things:

  • clamped holonomic base command (according to configured maximums)
  • calculated and clamped servo speeds (according to configured maximums)
  • servo speed and realtime tick state reported by the servos
  • the final state message

Next up is working on performance. Right now, it’s not too bad, but it’s a little slower than the default driver. The default driver seems to run at about 7-8Hz, but mine runs at about 5-6Hz. I’d like to get closer to 10Hz, if possible. I actually can get close to that if I do calculations in floats, but I want to explore other options.

Anyhow, I’ve added a bunch to the documentation, but please let me know if you run into any issues. I hope that this is useful for others. Regardless, it continues to be a lot of fun for me to learn isaac through this project.

Hi Blue Camel

This is impressive. Thanks for contributing to the Isaac SDK Community!

Thank you for Isaac and Kaya!