bmagyar / rosdevday-presentation

Material for "From ros_control to ros2_control" on ROS Developers Day 2021
3 stars 0 forks source link

Add "fakehardware" setup for rrbot to ROS1 #7

Open bmagyar opened 3 years ago

bmagyar commented 3 years ago

ros_control_boilerplate to the rescue? or fake_joint?

destogl commented 3 years ago

Creating this:

  1. Create a description package for your robot.

    1. Put all description files into urdf folder
    2. Create a view_robot.launch file in launch folder for testing the description.
    3. (optional) Create rviz folder to store default rviz configuration to view the robot.
    4. Start view_robot.launch to show the robot in rviz and move it using robot_state_publisher_gui package. Here you should test that all geometrical information are correct.
  2. Create a package with robot hardware interface.

    1. Create header and cpp file.
  3. Create robot bringup package:

    1. Add config/rrbot_controller.yaml file with the controller configurations.
    2. Add launch file for the RRBot hardware and controllers.
    3. Start the launch file.
    4. Open rqt and the plot plugin (Plot --> Visualization --> Plot)
      • Add data topics: "/joint_states/position[0]" and "/joint_states/position[1]"
    5. Publish new goal to the RRbot using
      rostopic pub /forward_position_controller/command std_msgs/Float64MultiArray "layout:
      dim:
      - label: ''
        size: 0
        stride: 0
      data_offset: 0
      data:
      - 0.5 
      - 0.5"
    6. You should see RRBot moving in Rviz and change of its state in rqt.
  4. Create a package with custom controller:

    1. Create header and cpp file.
    2. Add simple test for loading controller.
    3. Create another launch file in rrbot_bringup to start robot with new controller.
    4. Start the launch file
    5. Open rqt as described above
    6. Publish new goal to the RRbot using:
      
      rostopic pub /rrbot_controller/command control_msgs/JointJog "header:
        seq: 0
        stamp: {secs: 0, nsecs: 0}
        frame_id: ''
      joint_names: ['']
      displacements: [0.5, 0.5]
      velocities: [0]
      duration: 0.0"
    7. RRBot should move as in previous example.