lbr_fri_ros2_stack icon indicating copy to clipboard operation
lbr_fri_ros2_stack copied to clipboard

Commanding rate issue

Open cmower opened this issue 2 years ago • 3 comments

I have noticed some strange issues with publishing commands on the real robot. I am running the admittance controller example (I have tested with both the current Kinpy implementation and optas implementation in #53 in order to verify the issue is not with optas - I see the same behaviour with both versions).

When I run the example and check the hz of /lbr_command, i see

ros2 topic hz /lbr_command 
average rate: 499.911
	min: 0.000s max: 0.003s std dev: 0.00083s window: 501
average rate: 500.416
	min: 0.000s max: 0.003s std dev: 0.00083s window: 1002
average rate: 499.860
	min: 0.000s max: 0.003s std dev: 0.00083s window: 1501

However, I have verified in the admittance controller node script: (i) 100. commanding rate is being passed as the parameter, and the timer callback is running at 100hz (just by taking the time stamps between each successive call to the callback method.

The example isn't that clean anyway and I wonder if this has something to do with that.

@mhubii do you have any thoughts?

cmower avatar Mar 01 '23 14:03 cmower

I guess this depends on what is being launched. If the hardware interface is launched, then the control rate is set by the controller manager, e.g. https://github.com/KCL-BMEIS/lbr_fri_ros2_stack/blob/d1e70a7a1160ea2d3f29203b6ab83e2919292c29/lbr_bringup/config/lbr_controllers.yml#L3

Could you do a minimal bringup, ie launch

ros2 launch lbr_fri_ros2 lbr_spinner.launch.py

and report back the control rate? Think all these issues will be resolved once the bringup is being re-written.

mhubii avatar Mar 01 '23 15:03 mhubii

I guess this depends on what is being launched. If the hardware interface is launched, then the control rate is set by the controller manager, e.g.

https://github.com/KCL-BMEIS/lbr_fri_ros2_stack/blob/d1e70a7a1160ea2d3f29203b6ab83e2919292c29/lbr_bringup/config/lbr_controllers.yml#L3

Could you do a minimal bringup, ie launch

I use the following.

$ ros2 launch lbr_bringup lbr_bringup.launch.py model:=med7 sim:=false controller:=forward_position_controller

and report back the control rate? Think all these issues will be resolved once the bringup is being re-written.

The admittance node is publishing on /lbr_command .

cmower avatar Mar 01 '23 15:03 cmower

indeed solves the issue. Reminder to update the readme https://github.com/KCL-BMEIS/lbr_fri_ros2_stack/tree/foxy/lbr_examples#admittance-control, once bringup was re-written

mhubii avatar Mar 01 '23 15:03 mhubii