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

apply joint effort service call doesn't do much in gazebo

asked 2015-01-10 16:13:05 -0500

Bardia gravatar image

Hi,

I have a ros node that connects to my gazebo model. It makes a service call to rotate the joints (wheels). If I perform the ros service call from the cmd line I am able to see the wheels move. However, from the cpp node, it doesn't seem to move. Here is my cpp code:

gazebo_msgs::ApplyJointEffort r; 
    r.request.duration = ros::Duration(2.);
    r.request.joint_name = "right_wheel_hinge";
ros::ServiceClient client2 = gazebo.serviceClient<gazebo_msgs::ApplyJointEffort>("/gazebo/apply_joint_effort"); client2.call(r);

I have this in my main function of my cpp file. I am starting with Gazebo, so your help is appreciated

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2015-01-11 02:09:18 -0500

gvdhoorn gravatar image

updated 2015-01-11 07:39:42 -0500

gazebo_msgs::ApplyJointEffort r; 
r.request.duration = ros::Duration(2.);
r.request.joint_name = "right_wheel_hinge";
...

This may just be a copy/paste mistake, but are you setting the effort field of the ApplyJointEffort msg?

If you don't set it, it will initialise to 0, which could be an explanation for what you are seeing.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-01-10 16:13:05 -0500

Seen: 821 times

Last updated: Jan 11 '15