o3de / o3de-extras

Other
58 stars 60 forks source link

Fix issue with position control index processing #697

Closed nbbrooks closed 1 month ago

nbbrooks commented 1 month ago

What does this PR do?

This fixes an issue where the joints positions command at the first index is sent to all joints, instead of their respective commands.

I do not know the preferred convention for dual range loop iteration in C++17 (which I believe is what O3DE targets) so feel free to make changes!

How was this PR tested?

  1. Build an engine from the 92df6b PhysX Gem Split
  2. Build a Ros2RoboticManipulationTemplate project from this PR
  3. Added a JointsPositionsEditorComponent with J1-7 to panda_link0 image
  4. Command ros2 topic pub --once /position_controller/commands std_msgs/msg/Float64MultiArray "{data: [0.1, -0.69, 0.1, -2.26, 0.1, 1.47, 0.89]}" (this is 0.1 rad from the default starting position) from another terminal with the simulator running

If you build the project from upstream, the arm will attempt to move all joints to 0.1

Other notes

As a side note, servoing the arm using relative positions (e.g. with moveit_servo) has some issues with the default Articulation link settings for the Panda. They are quite aggressive motions, which ends up with a sort of bang-bang feedback loop that makes servoing unstable.

michalpelka commented 1 month ago

Thank you for fix @nbbrooks! I would like to merge, but you need to setup DCO https://github.com/o3de/o3de-extras/pull/697/checks?check_run_id=24734677415 please add a signoff message with your email address to your commit and force push. It should look like that:

Signed-off-by: Michał Pełka <michal.pelka@robotec.ai>
nbbrooks commented 1 month ago

Whoops, should be addressed now!