Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Namespace issue with differential drive controller when yaml file is passed in the robot xacro. #622

Open
suchetanrs opened this issue Nov 9, 2023 · 0 comments

Comments

@suchetanrs
Copy link

suchetanrs commented Nov 9, 2023


I want to spawn 'n' robots in Gazebo and all use the differential drive controller.
My yaml file is below. I am calling gazebo_ros2_control from the xacro file. This part of my xacro is also added below.
The problem is as follows:
left_wheel_names and right_wheel_names parameters are required to be written in the yaml file. These names are dependent on the namespaces of the robots. Like so, left_wheel_names: ['robot_ns/front_left_wheel', 'robot_ns/rear_left_wheel']. I believe this cannot be passed dynamically through the yaml file but can be through the xacro.
This issue did not occur with the base_frame_id and the odom_frame_id parameters since I used the "/**" at the start of the yaml and the frame_id was automatically set to "robot_ns/base_link". Can something similar to this be done for the left_wheel_names and the right_wheel_names?

yaml file is called in the xacro as follows:

<gazebo>
  <plugin filename="libgazebo_ros2_control.so" name="gazebo_ros2_control">
    <namespace>${robot_namespace}</namespace>
    <robot_param>robot_description</robot_param>
    <robot_param_node>robot_state_publisher</robot_param_node>
    <parameters>package://scout_description/config/scout_control.yaml</parameters>
  </plugin>
</gazebo>

the yaml file is as follows

/**:
  controller_manager:
    ros__parameters:
      update_rate: 100

      joint_state_broadcaster:
        type: joint_state_broadcaster/JointStateBroadcaster

      diff_drive_controller:
        type: diff_drive_controller/DiffDriveController

  diff_drive_controller:
    ros__parameters:
      left_wheel_names: ['robot_ns/front_left_wheel', 'robot_ns/rear_left_wheel']
      right_wheel_names: ['robot_ns/front_right_wheel', 'robot_ns/rear_right_wheel']

      wheel_separation: 0.50
      wheels_per_side: 2
      wheel_radius: 0.165
      wheel_separation_multiplier: 1.0

      pose_covariance_diagonal: [0.001, 0.001, 0.0, 0.0, 0.0, 0.03]
      twist_covariance_diagonal: [0.0001, 0.0, 0.0, 0.0, 0.0, 0.001]

      enable_odom_tf: true
      publish_rate: 50.0

      open_loop: false

      cmd_vel_timeout: 0.5
      use_stamped_vel: false
      velocity_rolling_window_size: 10

      preserve_turning_radius: true

      # Publish limited velocity
      publish_limited_velocity: true

      linear/x:
        has_velocity_limits: true
        max_velocity: 1.0
        has_acceleration_limits: true
        max_acceleration: 3.0

      angular/z:
        has_velocity_limits: true
        max_velocity: 2.0
        has_acceleration_limits: true
        max_acceleration: 6.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant