Skip to content
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

Changing velocity in "profile position" mode #15

Open
VahidAminZ opened this issue Mar 22, 2017 · 7 comments
Open

Changing velocity in "profile position" mode #15

VahidAminZ opened this issue Mar 22, 2017 · 7 comments

Comments

@VahidAminZ
Copy link

I would like to change the velocity in the profile position mode.
I can set it in the yaml but I would like to change it dynamically.
I could not find a service (or dynamic reconfigure, etc.) to do so.
Is it possible to do that with the existing package? If not, is there a reason why I cannot have a service to update the velocity?

@JimmyDaSilva
Copy link

So far it is not possible!
operation_mode_ is set only in the constructor of the Epos class:
https://github.com/RIVeR-Lab/epos_hardware/blob/indigo-devel/epos_hardware/src/util/epos.cpp#L39-L47

@VahidAminZ
Copy link
Author

@JimmyDaSilva That is correct but I do not want to change the operation_mode_ but change velocity in the "Profile position" mode.
If I am not mistaken it is set here:
https://github.com/RIVeR-Lab/epos_hardware/blob/indigo-devel/epos_hardware/src/util/epos.cpp#L411-L413

@JimmyDaSilva
Copy link

@VahidAminZ My bad !
That's it exactly. It's not coded anywhere in the ROS package, but in theory you could just call VCS(SetPositionProfile, velocity, acceleration, deceleration); any time to switch dynamically. You should try reading a param and calling this function inside Epos::write

That could be a great addition to this epos_hardware pacakge!

@VahidAminZ
Copy link
Author

@JimmyDaSilva I am a bit hesitant to poll the parameter server in case core is on a remote machine. It may create a delay in the control loop. What do you think about a rosservice that gets motor serial number and new velocity and sets it?

@JimmyDaSilva
Copy link

@VahidAminZ Yes, a service seems to be more appropriate because the velocity should not change at each step of the control loop.
You should try to see how the library responds to a sudden change of velocity.

@VahidAminZ
Copy link
Author

@JimmyDaSilva I will give it a try. If it was reasonable I will do a pull request.

@VahidAminZ
Copy link
Author

I added a service to change the velocity and submitted PR #19. I would appreciate any feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants