flexivrobotics / flexiv_ros2

ROS 2 integration of RDK for Flexiv robots.
Apache License 2.0
25 stars 11 forks source link

Feature/Add MoveIt Servo Config #26

Closed munseng-flexiv closed 9 months ago

munseng-flexiv commented 9 months ago

ADD

Example

In order to start realtime arm servoing with MoveIt Servo, please refer to the MoveIt documentation: Realtime Arm Servoing.

  1. Change the joint trajectory controller to velocity command interface in _flexiv_bringup/config/rizoncontrollers.yaml

    rizon_arm_controller:
    ros__parameters:
    joints:
      - joint1
      - joint2
      - joint3
      - joint4
      - joint5
      - joint6
      - joint7
    command_interfaces:
      - velocity
    state_interfaces:
      - position
      - velocity
    state_publish_rate: 100.0
    action_monitor_rate: 20.0
    allow_partial_joints_goal: false
    constraints:
      stopped_velocity_tolerance: 0.01
      goal_time: 0.0
    gains:
      joint1: {ff_velocity_scale: 1.0}
      joint2: {ff_velocity_scale: 1.0}
      joint3: {ff_velocity_scale: 1.0}
      joint4: {ff_velocity_scale: 1.0}
      joint5: {ff_velocity_scale: 1.0}
      joint6: {ff_velocity_scale: 1.0}
      joint7: {ff_velocity_scale: 1.0}
  2. Launch Moveit with "start_servo" enabled:

    ros2 launch flexiv_bringup rizon_moveit.launch.py robot_ip:=[robot_ip] local_ip:=[local_ip] start_servo:=true
  3. Send a service request to start Servo:

    ros2 service call /servo_node/start_servo std_srvs/srv/Trigger {}
  4. Send commands to the servo node to test if the robot moves, for example:

    ros2 topic pub /servo_node/delta_twist_cmds geometry_msgs/msg/TwistStamped "{ header: { stamp: 'now' },  twist: {linear: {x: 0.1}, angular: {  }}}" -r 10