ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How to load a controller from control_manager?

asked 2015-03-11 09:56:05 -0600

MarcoB gravatar image

Dears all,

I'm new to ROS_control and I'm investigating the possibility to use it to build an hardware-interface and a controller for a 6 gdl human-exoskeleton. To begin, I wrote a simple hardware-interface as the one in: https://github.com/ros-controls/ros_c...
I registered a "joint state interface" and a "joint effort interface" for all my joints and created the hardware-interface class. In my main program I created the controller_manager passing the created object as explained in the same tutorial. I could compile the code and run the so created control-loop; when it is running I can see the /controller_manager services trough "rosservice list".

My question is: if I want to use some "effort_controllers/JointPositionController" for my joints, how should I load them? As a beginning, I built a yaml configuration file and a launch file to load a joint controller as follows:

yaml file

robot: #what should robot be for? Package name? Namespace?
rHip_position_controller:
type: effort_controllers/JointPositionController
joint: rHip
pid: {p: 100.0, i: 0.01, d: 10.0} #random example values

and launcher

rosparam file="$(find biomot_control)/config/biomot_config.yaml" command="load"

node name="controller_spawner" pkg="controller_manager" type="spawner" respawn="false" output="screen" args="rHip_position_controller"

But when I launch it, it blocks at the step: Loading controller: rHip_position_controller. Am I missing any step or doing something wrong?

Also running "rosrun controller_manager controller_manager list-types" blocks without prompting any error or answer.

Thank you very much for the attention.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2015-03-11 10:41:14 -0600

gvdhoorn gravatar image

But when I launch it, it blocks at the step: [..]

[..]

Also running "rosrun controller_manager controller_manager list-types" blocks [..]

This reminds me of Unresponding control node on the ros-sig-robot-control list.

Without access to your actual code: make sure you service ros_control callbacks somewhere, as if those are not processed, it cannot correctly handle incoming service requests, which typically results in the hangs you are describing.

edit flag offensive delete link more

Comments

Thank you, that seems to be my problem. I fixed with a ros::spinOnce() in my control loop, I'm not sure that's the correct way to do it. Now I'm facing another problem, when loading:"Could not find parameter robot_description on param serv." I made a urdf file but I can't figure out how to load it.

MarcoB gravatar image MarcoB  ( 2015-03-11 12:55:47 -0600 )edit

EDIT: I had to start a dedicate thread running ros::spin as explained in the linked discussion. with position interfaces now controllers can load fine, to run effort interfaces I still need to understand how to get a proper xml description file from the urdf file.

MarcoB gravatar image MarcoB  ( 2015-03-11 16:38:54 -0600 )edit
1

You might be interested in the ros_control_boilerplate package by Dave Coleman.

gvdhoorn gravatar image gvdhoorn  ( 2015-03-12 05:03:26 -0600 )edit

Very interesting, thank you very much!

MarcoB gravatar image MarcoB  ( 2015-03-12 06:15:48 -0600 )edit

Question Tools

Stats

Asked: 2015-03-11 09:56:05 -0600

Seen: 1,904 times

Last updated: Mar 11 '15