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

Add velocity control mode #15

Merged
merged 13 commits into from
Mar 15, 2018
Merged

Add velocity control mode #15

merged 13 commits into from
Mar 15, 2018

Conversation

dogoepp
Copy link
Member

@dogoepp dogoepp commented Mar 9, 2018

Here a new control mode is supported : sending commands to servos in velocity command mode (wheel in Robotis' jargon).

The mode is detected in the servos but we require that the user declares the desired control mode with a ros parameter, to be sure to detect wrong assumption on the current control mode of a servo.

@dogoepp dogoepp self-assigned this Mar 9, 2018
@dogoepp dogoepp requested a review from costashatz March 9, 2018 08:02
@costashatz
Copy link
Member

Here a new control mode is supported : sending commands to servos in velocity command mode (wheel in Robotis' jargon).

Thanks for this nice PR..

the user declares the desired control mode with a ros parameter

Is this really necessary? Or you did it for safety?

@dogoepp
Copy link
Member Author

dogoepp commented Mar 9, 2018

For the sole sake of safety I added this limitation to user-friendliness. I still wonder if it is a good idea.

Dorian Goepp added 3 commits March 14, 2018 15:23
Copy link
Member

@costashatz costashatz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This overall seems nice! Only one question/remark: ROS_ERROR_STREAM and ROS_FATAL_STREAM do not exit the program right? I think we should terminate the program, especially for the ROS_FATAL_STREAM cases..

@dogoepp
Copy link
Member Author

dogoepp commented Mar 14, 2018

You're right for the fatal that should exit.

For the errors related to command interface type (position/velocity), the joints concerned are disabled. Is that not enough ? Do we need to give such a strong signal as to crash the whole program ?

Copy link
Member

@costashatz costashatz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like how this code is becoming. Good job @dogoepp! Some very minor comments...

}
catch (XmlRpc::XmlRpcException& e) {
ROS_FATAL_STREAM("Exception raised when parsing the configuration: " << e.getMessage());
return 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most probably naive question, but just making sure. This should be enough to not allow incorrect configurations right? I.e., nothing is needed in the dynamixel_hardware_interface.hpp file. Just making sure..

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is an incorrect configuration for you ?

The above code should only accept well-structures configuration. However, it does not prevent the addition of unused parameters (which are then ignored).
If a parameter is expected to be an integer but is of an other type, an exception is raised and causes the program to stop. Saddly, the exception message is not informative. I don't know how to improve this, except by splitting this try/catch in more, smaller ones.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The above code should only accept well-structures configuration.

That's what I correct configuration is for me..

If a parameter is expected to be an integer but is of an other type, an exception is raised and causes the program to stop.

And that's what an incorrect configuration is for me. 😄

However, it does not prevent the addition of unused parameters (which are then ignored).

This is ok.

Saddly, the exception message is not informative. I don't know how to improve this, except by splitting this try/catch in more, smaller ones.

I think we should not bother too much for this.. It is not of that big importance..

Great! This is ok for me then!


// enable torque output on the servo and set its configuration
// including max speed
_enable_and_configure_servo(_servos[i], hardware_mode);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I am not mistaken, when the hardware_mode is OperatingModel::unknown we should not enable the servo but from what I see we still set_torque_enable(1) in this function (_enable_and_configure_servo) no matter the mode. Of course, I might be missing something..

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. Fixed

Dorian Goepp and others added 4 commits March 15, 2018 10:52
In this case, we are talking about actuators which operating mode
(position or velocity) is not declared, improperly declared or does not
match the hardware setting.
Copy link
Member

@costashatz costashatz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dogoepp this should be good to merge! Great job! Can you only check my last commit
864bf9f ?

@dogoepp
Copy link
Member Author

dogoepp commented Mar 15, 2018

Looks good. Thanks !

Merging

@dogoepp dogoepp merged commit 7d8d161 into master Mar 15, 2018
@dogoepp dogoepp deleted the velocity-mode branch March 15, 2018 10:28
@costashatz costashatz restored the velocity-mode branch June 13, 2018 12:37
@dogoepp dogoepp deleted the velocity-mode branch June 19, 2018 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants