Home | Tutorials | Wiki | Issues
Ask Your Question
1

Cannnot get joint torque while setting velocity command for joints

asked 2014-09-03 23:38:46 -0600

murooka gravatar image

updated 2014-09-03 23:41:01 -0600

I use following plugin for controlling joints. https://github.com/start-jsk/rtmrosgazebo/blob/master/hrpsysgazebo_general/src/IOBPlugin.cpp

I'm sending velocity command to joint by SetVelocity function, and trying to get joint torque by GetForce function, but return value of GetForce is always zero.

When I send torque command by SetForce function, I can get correct joint torque by GetForce.

edit retag flag offensive close merge delete

Comments

I posted the question referred above, but hasn't received a response yet. Has anyone found a way around this problem?

Daniel L gravatar imageDaniel L ( 2015-01-19 13:52:06 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
3

answered 2015-01-20 18:03:54 -0600

hsu gravatar image

updated 2015-01-20 18:25:24 -0600

SetVelocity bypasses physics (see the call to SetVelocityMaximal underneath), so forces were not computed based on target velocity. To do this in a physically realistic fashion, write a force based PID controller that takes velocity target as feedback, and GetForceTorque should give you more physically meaningful readings.

edit flag offensive delete link more

Comments

When I tested SetVelocity() with DefaultRobotSim, if you sent a command to a joint from Gazebo's Joints pane, non-zero force values would start being returned from there on for that particular joint, even if you stopped using the pane and started a ros_control controller. Why is this the case? My original question is here: http://answers.ros.org/question/201068/gazebo-joints-getforce-returns-zero-when-used-in-conjunction-with-setmaxforce-and-setvelocity/

Daniel L gravatar imageDaniel L ( 2015-01-24 17:10:52 -0600 )edit

GetForceTorque works well. Thank you!

murooka gravatar imagemurooka ( 2015-06-22 03:21:45 -0600 )edit
2

answered 2015-01-20 14:07:54 -0600

nkoenig gravatar image

Can you try using Joint::GetForceTorque?

edit flag offensive delete link more

Comments

Thank you. It worked.

murooka gravatar imagemurooka ( 2015-06-22 03:22:48 -0600 )edit
Login/Signup to Answer

Question Tools

2 followers

Stats

Asked: 2014-09-03 23:38:46 -0600

Seen: 2,821 times

Last updated: Jan 20 '15