Different controller reactions at publishing messages via transfer functions and via ros terminal



I recognized something weird about the transfer function. I want to figure out if I can use the efforts of the joints to detect a contact with an object. I started a little experiment with the arm_robot and let the index finger collide with a box. Like this

At first I have to say I modified the arm robot model and scaled down the Collision boxes around the fingers so I know this has influence of the controller but the controller seems to do something different only because I publish the messages with the transfer function.

When I publish the ros message via the transfer function I get this joint plot (The finger begin to move at 216)

When I deactivate the transfer function and publish the same values via the ros terminal I get this Joint plot:

In addition when the robot arrives at a position via the transfer function the Arm is shaking a little bit, but when it gets to a position via ros terminal it’s not.

Is there a reason why the controller behaves in different ways?

Here is the code I used in the transfer function:

@nrp.MapRobotPublisher(“topic_elbow”, Topic(’/robot/hollie_real_left_arm_3_joint/cmd_pos’, std_msgs.msg.Float64))
@nrp.MapRobotPublisher(“topic_wrist”, Topic(’/robot/hollie_real_left_arm_6_joint/cmd_pos’, std_msgs.msg.Float64))
@nrp.MapRobotPublisher(“topic_index_prox”, Topic(’/robot/hollie_real_left_hand_Index_Finger_Proximal/cmd_pos’, std_msgs.msg.Float64))

def hand_effort_experiment (t, topic_elbow, topic_wrist, topic_index_prox):

#move arm to box

#finger collision with box  

Best regards and many Thanks in advance


Hi Katharina,

Could you post the exact commands you used for publishing the ROS messages?
It is possible that the rate at which you are publishing doesn’t match the rate of the CLE.

To control the robots, transfer functions publish on the same topics at each timestep of the simulation; the default rate of publishing is then 50Hz if the simulation can be run in real time.

Give a try publishing at different rates (the default is 10 Hz):
rostopic pub --rate=RATE /topic


Thank you very much.

Here are the ros commands I used to get in the arm position and flex the index finger:

rostopic pub /robot/hollie_real_left_arm_3_joint/cmd_pos std_msgs/Float64 “data: 1.55”
rostopic pub /robot/hollie_real_left_arm_6_joint/cmd_pos std_msgs/Float64 “data: 1.5”
rostopic pub /robot/hollie_real_left_hand_Index_Finger_Proximal/cmd_pos std_msgs/Float64 “data: 1”

I tested different rates with --rate and it get worse with lower rates. But with a rate of 5 Hz it is still ways better than with the transfer function and the contact can still be seen in the efforts sending via ros. With the transfer function it looks like the noise in the screenshot below.
The screenshot shows two plots above the robot hold one position with the transfer function. Below its with the ros topics with a rate of only 5Hz. Notice the scaling of the axis differs with a factor of 100.