0
$\begingroup$

Rosanswers logo

hi, in my gtest i do a service call

ros::ServiceClient client = nH.serviceClient<gazebo_msgs::ApplyJointEffort>("/gazebo/apply_joint_effort"); EXPECT_TRUE(client.call(r));

this service call returns true, the response message tells me: ApplyJointEffort: effort set

but the effort is not applied to the model in the running gazebo simulator ?

I have checked the network tcp/ip streams, and see that there are some packets talking about the service /gazebo/apply_joint_effort, but i cannot see anywhere some values i send like duration,start_time,effort ?

How can i do a better inspection of the services? what could this error cause?

thanks flo


Originally posted by inflo on ROS Answers with karma: 406 on 2013-03-24

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

hi, as this topic is very interresting, see view-count :) i will answer it by myself.

If you use the cmdline tool "rosservice" with the command "call" you can specify, e.g. when calling /gazebo/apply_joint_effort service, the duration. This duration is of type ros::duration. You can check this by calling:

rosservice info gazebo/apply_joint_effort Node: /gazebo URI: rosrpc://ros:43892 Type: gazebo_msgs/ApplyJointEffort Args: joint_name effort start_time duration

The type gazebo_msgs/ApplyJointEffort contains ros::duration as type of the duration.

But when you can e.g. (with -v for verbose outpt):

rosservice call -v gazebo/apply_joint_effort '{joint_name: myjoint, effort: 100, start_time: 0, duration: 100000}'

you can see, that rosservice uses the 100000 as nanoseconds:

duration: secs: 0 nsecs: 100000

But if you use the ros::ServiceClient and set the duration with:

gazebo_msgs::ApplyJointEffort r; r.request.duration = ros::Duration(100000.);

you set 100000. seconds.

If you print out the values in seconds from inside gazebo_ros_api_plugin.cpp:GazeboRosApiPlugin::applyJointEffort() function, you get with rosservice call:

duration >0.000100<

and with ros::duration(100000.) you get:

duration >100000.000000<

So if you know this, adjust your values and it will work.

flo


Originally posted by inflo with karma: 406 on 2013-03-29

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.