resibots / libdynamixel

C++ interface to the dynamixel actuators
GNU General Public License v2.0
9 stars 15 forks source link

Protocol 2 brought to MX series ? #30

Closed dogoepp closed 6 years ago

dogoepp commented 7 years ago

There is now a firmware for MX28, MX64 and MX106 that talks protocol 2.

Open questions:

  1. how should we handle this in our library : the model numbers changed so it is straightforward
  2. how to perform the upgrade, if possible : through R+
  3. once upgraded, can they still talk protocol 1
naoki-mizuno commented 6 years ago

I'm currently trying to write a description hpp for MX106, mostly basing it off of pro_h54_200_s500.hpp . However, I wasn't sure how to find the non-common fields. Is there a list somewhere?

dogoepp commented 6 years ago

The common fields are declared in servo.hpp. Don't forget either to add any new fields to base_serv.hpp which declares methods for all fields that belong to at least one supported model.

dogoepp commented 6 years ago

Also, we will need to update auto_detect.hpp.

naoki-mizuno commented 6 years ago

Thanks! I'll take a look at those files and see what I can do.

naoki-mizuno commented 6 years ago

I've implemented the header file for MX106 supporting protocol 2. I haven't tested this with on actual MX106 yet (I will as soon as I get access to one, which will be within the next week), but any feedback regarding naming convention/ordering etc. is welcome! The read/write fields, address, and the data size in bytes are based on the official control table.

https://github.com/naoki-mizuno/libdynamixel/commit/27e0f908ef4fb53183a10cf6882a343c0a79e369

dogoepp commented 6 years ago

It looks great! Let me know when you have had an occasion to test it.

Maybe you could put the new fields in base_servo.hpp in the group that best matches their meanings ?

naoki-mizuno commented 6 years ago

I tested it and it worked! :smile: I used an MX106 with protocol version 2 (firmware 41.0). p2-dynamixel list showed:

Connected devices (1) :
1       Mx106P2

I then used the dynamixel_control_hw to successfully do a position control on the MX106.

Maybe you could put the new fields in base_servo.hpp in the group that best matches their meanings ?

I'm not quite sure what you mean. I couldn't find the grouping condition for the BASE_FIELDs in base_servo.hpp (for example, these lines seems have been added because of the fields in Dynamixel Pro control table). If you can give a pointer on how to organize them, I'd be glad to incorporate that and send a PR!

naoki-mizuno commented 6 years ago

I've added support for MX-28 and MX-64 in addition to the already tested MX-106. I have tested MX-28, but I couldn't find an available MX-64. If you have access to one could you test it?

dogoepp commented 6 years ago

Maybe this is actually a good time to group the fields in a logical manner : separating the ROM and RAM fields and within these categories the ones specific to protocol2. I can do the changes and do a pull request on your branch, if you wish.

naoki-mizuno commented 6 years ago

Ah, that makes sense. If you could send me a PR that would be great. Or, maybe just merge #45 and make the changes on this repo's master branch :)

dogoepp commented 6 years ago

You're right. I'll do the changes directly on this repository.

Besides, I could not upgrade the firmware of one of our MX-64. I tried using RobotPlus 2.0 but it did not offer to upgrade the firmware. How did you do ?

naoki-mizuno commented 6 years ago

You're right. I'll do the changes directly on this repository.

:+1:

I tried using RobotPlus 2.0 but it did not offer to upgrade the firmware. How did you do ?

I had to upgrade the R+ Manager to the latest version. Otherwise, it didn't recognize the MX servos. Sometimes it doesn't automatically prompt you that a latest version is available, and you need to click on the "update" button (left column, second button from the right next to the power icon).

R+ Manager

dogoepp commented 6 years ago

Re-organisation of the fields is done in #47.

As for testing with MX-64, I could not succeed to upgrade the firmware. R+ manager says that I have the latest version of the firmware. I assume that it means that the 3-wire version of MX-64 cannot be upgraded. Which version of the MX servos do you have ?

naoki-mizuno commented 6 years ago

I tested using the newer MX series. I remember hearing something about the older ones not being able to update itself to the latest firmware. If I get access to a newer MX-64 I'll make sure to test the code on that. Anyways I think the issue can be closed now :)

dogoepp commented 6 years ago

Yes, thanks