ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

modbus with ros control

asked 2021-06-19 05:31:00 -0500

dinesh gravatar image

Currently i'm using modbus rtu to control the robot base where i have used diff drive controller. I also have to control the rotation of a camera from the same modbus rtu connection as another modbus slave. But right now i'm stuck in how can i use different ros controllers like diff drive controller, joint position controller as different ros node sincem modbus rtu port is single?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-06-20 13:42:38 -0500

dinesh gravatar image

updated 2021-06-20 13:43:41 -0500

Ok now i got it. By using single hardware interface multiple actuators can be controlled with the help of different ros controllrs. Eg. right now i have two controllers on diff drive controller which controls the base of robot and another joint position controller which controls the head rotation of robot. Here is my example configuration file for the controller and hardware interface both. I'm using ros control boilerplate package for faster development.

# ros_control_boilerplate Settings -----------------------
# Settings for ros_control control loop
generic_hw_control_loop:
  loop_hz: 300
  cycle_time_error_threshold: 0.01

# Settings for ros_control hardware interface
hardware_interface:
   joints:
      - wheel_left_joint
      - wheel_right_joint
      - camera_joint
   sim_control_mode: 1 # 0: position, 1: velocity

# Publish all joint states ----------------------------------
# Creates the /joint_states topic necessary in ROS
joint_state_controller:
   type:         joint_state_controller/JointStateController
   publish_rate: 50

# Position Controllers ---------------------------------------
turtlebot3_waffle_head_controller:
  type: effort_controllers/JointPositionController
  joint: camera_joint
  pid: {p: 100.0, i: 0.01, d: 10.0}

base_controller:
  type        : "diff_drive_controller/DiffDriveController"
  left_wheel  : 'wheel_left_joint'
  right_wheel : 'wheel_right_joint'
  publish_rate: 50.0               # default: 50
  enable_odom_tf: True
  pose_covariance_diagonal : [0.001, 0.001, 1000000.0, 1000000.0, 1000000.0, 1000.0]
  twist_covariance_diagonal: [0.001, 0.001, 1000000.0, 1000000.0, 1000000.0, 1000.0]
  # Wheel separation and diameter. These are both optional.
  # diff_drive_controller will attempt to read either one or both from the
  # URDF if not specified as a parameter
  wheel_separation : 0.35
  wheel_radius : 0.085
  # Wheel separation and radius multipliers
  wheel_separation_multiplier: 1.0 # default: 1.0
  wheel_radius_multiplier    : 1.0 # default: 1.0

  # Velocity commands timeout [s], default 0.5
  cmd_vel_timeout: 0.25

  # Base frame_id
  base_frame_id: base_footprint #default: base_link

  # Velocity and acceleration limits
  # Whenever a min_* is unspecified, default to -max_*
  linear:
    x:
      has_velocity_limits    : true
      max_velocity           : 0.5  # m/s
      min_velocity           : -0.5 # m/s
      has_acceleration_limits: false
      max_acceleration       : 0.2  # m/s^2
      min_acceleration       : -0.2 # m/s^2
      has_jerk_limits        : false
      max_jerk               : 0.01  # m/s^3
  angular:
    z:
      has_velocity_limits    : true
      max_velocity           : 1.75 # rad/s
      has_acceleration_limits: false
      max_acceleration       : 0.5  # rad/s^2
      has_jerk_limits        : false
      max_jerk               : 0.01  # rad/s^3

Beauty of this design as if found is that modbus, ethercat based multiple motor drivers can be intefaced from single ros node called hardware interface.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2021-06-19 05:31:00 -0500

Seen: 725 times

Last updated: Jun 20 '21