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
Can't initialize effort_controllers/JointPositionController with non-global robot_description parameter #244
Comments
Hiya, Which ROS distribution are you running? |
@bmagyar. I'm on Kinetic. Multi-robot simulations have always been a mess :) I have separate controller managers per robot, each launched via a separate gazebo_ros_control plugin (here). Now gazebo_ros_control creates a correctly namespaced NodeHandle, and passes it to the init function as you mentioned (even though the node is running in the global namespace). However, Model::initParam creates its own nodehandle here, and does not use the NodeHandle passed in the init function of the controller. I believe they are expecting initParam to run as part of a node in the correct namespace (/robot1), but instead here it runs inside the gazebo node, which is in the global namespace. I propose to replicate Model::initParam's search functionality in each controller, using the NodeHandle provided in the init function. |
How about adding an extra optional nodehandle argument to initParam? That would probably be a more consistent change and many others could benefit from it directly. Then the nodehandle in controllers could be passed. I'm trying to think about the cleanest solution here. |
@bmagyar: That sounds fine to me, and I think I can introduce the change in backwards compatible way. I'm fine implementing whatever change you suggest, since my experience with |
@wjwwood, what is your opinion on adding this to the ROS urdf API? |
Wouldn't it be simpler and less intrusive if we just added a parameter in the namespace of the controller just as the other parameters that specifies (if set) the path to the URDF file in the server? That would even allow different names (not only robot_description) and would cause no changes to the API of the urdf::Model class. |
@piyushk Could you please provide the matching PR here as well so that guys over at robot_model can assess the need for it? @progtologist |
@bmagyar I am proposing something as simple as this:
|
I understand the workaround but I believe we should not do it. I prefer to only add new parameters relevant to the controllers, plus the point about not allowing names other than There's always a way to add more configuration and make more things explicit but then we are sliding down the slope towards configuration hell soon to also roast in dependency hell. |
@bmagyar: I've done so. In addition the workaround proposed by @progtologist has already been implemented in a couple of controllers: The following controller seems to be doing it's own vairant: I can also unify all of these solutions to that proposed in PR #245, however I don't know if I have a clear way of testing them. |
@bmagyar sorry I didn't respond right off. I haven't had time to completely catch up with the issue here, so I'm not entirely clear on what "it" is in this case (that you'd like to add to urdf), but I gather it is changing or adding API to allow passing in a NodeHandle to some part of the URDF API to better handle namespacing? I think that might be ok, but honestly I don't have enough context to see whether or not it makes sense. I'm sorry that I don't have better guidance for you guys, but you'll have to figure out what should be what on your own and propose a change to me if you think one is required. You're best bet for getting feedback on whether or not something could be put into URDF is to describe what you're thinking of in more detail for me, a preliminary pull request which demonstrates the API changes would be best. |
@wjwwood: Here's a summary of the changes in PR form: In short, NodeHandles constructed for controllers in Gazebo can be in a different namespace (/robot1/) than the default namespace (/), so the parameter search for |
Thanks @piyushk, sorry for not associating this issue with the robot model pr. I'm still trying to catch up my email. I'll comment on it asap. |
@wjwwood, @bmagyar don't get me wrong, I also prefer the "clean" change in the urdf::Model, however I am hesitant as I don't want to wait for a long time until this gets integrated. What @piyushk is suggesting is much better than my proposition, but it is also slower to get to the users (and benefit from this). |
I didn't see it mentioned here. What do you think about the JointPositionController calling resolveName("robot_description") and passing the fully qualified name into urdf::Model::initParam()? |
According to the code, this should be the default behaviour. |
The default behavior for Currently |
Ref: http://answers.ros.org/question/249138/cant-initialize-effort_controllersjointpositioncontroller-with-non-global-robot_description-parameter
Here's an outline of my problem:
effort_controllers/JointPositionController
(running inside Gazebo) callsurdf::Model::initParam
which does not respect the controller's constructed namespace, and executes asearchParam
in Gazebo's global namespace, which fails.I can't figure out how to tell the controller to read the robot_description from
robot1/robot_description
.Furthermore, It's unclear to me why each controller is trying to read the URDF independently in the first place. Doesn't it make more sense to use the controller manager.
If this issues needs a patch, and I can provide one. Would an acceptable solution be that I duplicate Model's search inside a controller, since the controller has the correct NodeHandle?
The text was updated successfully, but these errors were encountered: