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

Added an Enable service to turn a servo "on" or "off" so it ignores position requests #14

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

pirobot
Copy link

@pirobot pirobot commented Mar 6, 2014

Hi Anton,

I added an Enable service to joint_controller.py and joint_position_controller.py that takes a value of True or False and sets a flag called self.enabled for that servo. The default value is self.enabled = True to ensure backward compatibility. If set to False, then a position request is simply ignored (see the modified process_command() function below).

My use case is that I have a node that monitors the temperature of each servo using the Diagnostics array and, if a servo overheats, I disable that servo to let it cool down. I tried it with a second node that does head tracking and it works nicely--if the tilt servo begins to overheat, my monitor node disables the tilt servo but the pan servo keeps working.

I deliberately did not call set_torque_enable() when calling set_enable() as I thought these two functions should be kept separate. So to truly let a servo cool down, my monitor node first calls set_torque_enable(False) and then set_enable(False) on the overheated servo.

@pirobot
Copy link
Author

pirobot commented Mar 6, 2014

Hi Anton,

I don't see the comment here I received from you via email which was:

"Does this work with JointTrajectoryAction controller? Do you think you can add support for it?"

In any event, I'd be happy to try it with the JointTrajectoryAction controller but I can't get the JointTrajectoryAction controller to work properly using your current master branch (see #10). So I might have to start over again with your latest release branch since that one works fine for me with regard to the trajectory stuff.

@pirobot
Copy link
Author

pirobot commented Mar 6, 2014

Do you know what the last commit was before the 0.4.0-1 release was made for Ubuntu Precise?

@arebgun
Copy link
Owner

arebgun commented Mar 6, 2014

Here's the list of commits:

https://github.com/arebgun/dynamixel_motor/commits/master

I don't see anything that relates to services (the last substantive change before 0.4.0 release was catkinization), why do you ask?

@pirobot
Copy link
Author

pirobot commented Mar 6, 2014

The trouble is that when I install your current master branch and do a catkin_make, my dynamixel startup launch file no longer brings up the joint controllers, no matter how many times I run it. (Or once in awhile it will bring up one or two joint controllers for one or two servos but not the rest.) This is basically the same issue as we are discussing in #10. On the other hand, my dynamixel startup launch file runs fine using the Debian packages for dynamixel_motor and ROS Hydro under Ubuntu 12.04. So the only way I can test any changes my Enable service will make to the JointActionTrajectory controller is to start with your code the way it was at the time of the last Hydro release.

@arebgun
Copy link
Owner

arebgun commented Mar 6, 2014

Right, I understand. I think the two biggest changes relating to controller startup are the two from February 13th:

  1. 0bccd3a
  2. b447b98

Could you see if the behavior is the same as in 0.4.0 without these two commits? I am really shooting blind here as I don't have access to Dynamixels anymore since I am not at the university anymore.

@pirobot
Copy link
Author

pirobot commented Mar 6, 2014

OK, no problem. I hope to get a chance to work on it later today.

@pirobot
Copy link
Author

pirobot commented Mar 7, 2014

Hi Anton,

OK, I went back to an earlier commit (as you can see in the comment above) and then was able to add the enable/disable servo support to the JointActionTrajectory controller. The approach I took was that if any servo required to execute the trajectory is currently disabled, then an error message is displayed indicating that the trajectory cannot be executed because one or more required servos is disabled. I tested it with MoveIt and I was able to turn a trajectory on or off by disabling one of the servos.

Hope you can make sense of the various commits in this pull request. I'm not sure how easy it will be to merge things with your current master...

@pirobot
Copy link
Author

pirobot commented Mar 11, 2014

Hi Anton,

Just checking if the above comment is enough for the pull request. Let me know if you need more info or if I should try to recreate the pull request using the current commit of your master branch.

@pirobot
Copy link
Author

pirobot commented Mar 25, 2014

Ping. :-)

@arebgun
Copy link
Owner

arebgun commented Mar 30, 2014

Hey Patrick, sorry, I've been busy. I will try to merge it first thing on Monday, the pull request as is undoes a bug fix, so I'll have to cherry pick your changes.

@pirobot
Copy link
Author

pirobot commented Mar 31, 2014

Hi Anton,

No problem and thanks!

@pirobot
Copy link
Author

pirobot commented May 22, 2014

Hi Anton,

I was wondering if you would like me to resubmit my pull request using your latest commit as a starting point. Perhaps that would make it easier to review and merge?

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

Successfully merging this pull request may close these issues.

2 participants