tu-darmstadt-ros-pkg / hector_quadrotor

hector_quadrotor contains packages related to modeling, control and simulation of quadrotor UAV systems.
Other
379 stars 276 forks source link

Controller loading #41

Open AbdealiLoKo opened 9 years ago

AbdealiLoKo commented 9 years ago

I found the line <node name="controller_spawner" pkg="controller_manager" type="spawner" respawn="false" output="screen" args="controller/twist --shutdown-timeout 3"/> is a launch file in the example and have been using that in my launch files.

Today I noticed that the controller takes time to spawn, which causes the quad to move randomly for a few seconds in the beginning. This is problematic for my simulations.

I am trying to load the twist controller from a service using:

ros::service::waitForService("/controller_manager/load_controller", -1);
load_controller = node.serviceClient<controller_manager_msgs::LoadController>(
    "/controller_manager/load_controller");
controller_manager_msgs::LoadController load_controller_msg;
load_controller_msg.request.name = "hector_quadrotor_controller/TwistController";
load_controller.call(load_controller_msg);
assert(load_controller_msg.response.ok);

but the controller never responds with an OK ... any tips on how do I debug this ?