-
Notifications
You must be signed in to change notification settings - Fork 274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for custom modes #289
Comments
I'm working on supporting a custom motor controller with a Master / Follower mode similar to the Maxon EPOS MasterEncoder mode, so I'd like to start implementing this. My focus will be on what you have listed as changes for kinetic, custom modes with one command. Many manufacturer specific modes are single command modes with different behavior so we really just need to find a way to dynamically create new modes based on For my application I actually want to create a mode that changes the mode of the controller but doesn't forward commands as the motor is configured as a follower. As you pointed out pos_vel and pos_vel_acc should also eventually be implemented. Finally for complex custom changes, users can derive from Motor / MotorBase and create a new Motor402 Allocator; I haven't looked into this much and think there might be some trickiness to the interface mapping issues. The issues that I have identified for one command custom modes are:
For configuration I would imagine something along the lines of: custom_operation_mode:
name:
id: -1
suppored_drive_bit: 16
interface: "hardware_interface::VelocityJointInterface"
od_entry: "obj60FF"
data_type: "int32_t" Have I summarized the above well? Any thoughts? |
Thanks for the detailed summary!
I would say that this step is optional. This could be solved with another plugin system once the other issues are solved.
Again, more or less optional.
I am not sure if vendor-specific modes get reflected in
That's the tricky one. |
Hmm, it looks like I misunderstood. Bits 16-31 are listed as Manufacturer Specific in 0x6502 so I had assumed they corresponded to the Manufacturer Specific Operation Modes, but after reviewing implementations from a number of companies it doesn't appear that they are used that way. I quickly looked at (Drives with Vendor Specific Modes marked as VSM):
and the only Vendor who implemented Vendor Specific Modes AND used the Supported Drive Mode bits was Moog (PDF). While not exhaustive (and I may have missed some VSMs in the above list), it certainly looks like there is another issue: Drives have VSMs without any indication. So we'd either have to automatically look up supported modes from a hard-coded table or include it in the config yaml somehow. I think creating another Plugin is a good idea, but would we want to create a number of included plugins for each Vendor that users can switch between using an allocator string? That definitely seems better than trying to automatically look-up during run-time from ID Entries, but duplication would certainly be a concern.
I'm going to think about this part a bit more and look into where / what the plugin would consist of. |
I would query it from the
The modes could be registered from the vendor-specific We could even mix both ;) |
Questions:
Does this mean you'd add some kind of On first thought0, this feels a little backwards and risks having isModeSupported functions that end up listing out all of the motor drives that support them: virtual bool Mode::isModeSupported(&storage) {
return isMaxonEPOS() || isBeckHoff() || ... ;
} Though, admittedly, if many vendors supported the same modes they wouldn't be vendor specific so this problem seems unlikely. Implementation PlanMy first pass at this is going to try to change things so that a new Motor can be derived from MotorBase / Motor and add new vendor specific modes that get registered with This partial support would solve my immediate need and get you some code to check that we're actually on the same page. After that as time permits I could implement the plugin system. interface_mappingSome issues with the current interface_mapping:
So my proposal would be to create an interface mapping per Motor, add the hardware_interface string to Mode, then build the interface_mapping during initialization. This way the Default Modes will be provided by For this implementation I'd have to add an interface_mapping to Thoughts? |
Hi @BenArtes! Cheers! |
I did succeed in adding custom mode support but haven't had the time to clean up the various ros_canopen additions to create a PR. Essentially I replaced the Then I used the canopen402 plugin to create a custom plugin with a custom |
That's great to know! |
Unfortunately not, it's on an internal repository waiting to be cleaned up and pushed to a public server at which point I'll create a PR and try to get the changes merged into ros_canopen. I'd been hoping to do that sooner, but we're still deep in R&D phase and I am unlikely to get the time to cleanup and publicly publish the changes until we get closer to release and delivering to customers. |
Thanks for the prompt answer, I'll look into replicating your work in the meantime then. Good luck in your endeavors! |
For kinetic:
auto-support all <0 modesFor melodic:
The text was updated successfully, but these errors were encountered: