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

husky wheel odom #192

Open
narutojxl opened this issue Dec 1, 2021 · 3 comments
Open

husky wheel odom #192

narutojxl opened this issue Dec 1, 2021 · 3 comments

Comments

@narutojxl
Copy link

narutojxl commented Dec 1, 2021

Hello authors,
I'm using noetic-devel branch. I run roslaunch husky_gazebo husky_empty_world.launch with the default config, laser_enabled = 0, laser_secondary_enabled =0, laser_3d_enabled =0, realsense_enabled =0. I don't modify anything except I add libgazebo_ros_p3d.so into husky.urdf.xacro to get fake localization pose. When i use a logitech joystick to drive husky in gazebo empty.world, i find /husky_velocity_controller/odom topic's x and y are very different from /ground_truth/state topic's x and y position. map frame is the same with odom frame, /husky_velocity_controller/odom pose is in odom frame by default.

  <gazebo>
    <plugin name="p3d_base_controller" filename="libgazebo_ros_p3d.so">
      <alwaysOn>true</alwaysOn>
      <updateRate>20.0</updateRate>
      <bodyName>base_link</bodyName>
      <topicName>ground_truth/state</topicName>
      <gaussianNoise>0.01</gaussianNoise>
      <frameName>map</frameName>
      <xyzOffsets>0 0 0</xyzOffsets>
      <rpyOffsets>0 0 0</rpyOffsets>
    </plugin>
  </gazebo>

husky_速度订阅关系

Then i compare vx and wz of /cmd_vel, /husky_velocity_controller/cmd_vel, /husky_velocity_controller/odom and /ground_truth/state. I find /cmd_vel, /husky_velocity_controller/cmd_vel and /husky_velocity_controller/odom are the same in vx and wz respectively. In other word, /husky_velocity_controller/odom vx is the same with gazebo received vx of /husky_velocity_controller/cmd_vel, /husky_velocity_controller/odom wz is the same with gazebo received wz of /husky_velocity_controller/cmd_vel. Please see the following two pictures, the first one is vx comparison chart, the second is wz.

My question is:

  • Is /husky_velocity_controller/odom husky's wheel odom? If it is, why the velocity vx and wz is very different from the measured feedback velocity?
  • Why husky does not track the received speed not well, as we see in the two chart?
  • I noticed when i send a wz≠0, vx=0 on the /cmd_vel, robot in gazebo doesn't rotate in place, it does a weird go front - go back in the rotate motion, similar problem in #105 and #120. In the #PR191 , the author says

Thanks for the PR! For the Gazebo turning bug, I have noticed it too. Changing the friction didn't seem to fix it but it has been a while since I have looked into it. I'll take another look when I get a chance.

  • Thanks for your any suggestions a lot!
    husky_odom_线速度
    husky_角速度
@destogl
Copy link

destogl commented Dec 6, 2021

Hi @narutojxl,

You probably have in the parameters of Diff Drive controller set "open_loop" to true. This ignores the feedback from hardware and publishes odometry based on the commanded velocity.

The other issue with simulation is caused by unsuitable friction parameter on the Wheels, see #191 for the adjustments.

@narutojxl
Copy link
Author

narutojxl commented Dec 7, 2021

Hello @destogl, thanks for your kind reply. I don't find open_loop param in control.yaml. In vscode, i also search with open_loop, donn't find somewhere. This is control.yaml content, is there anything i missed? I clone from husky noetic repository. I will merge #PR191 to my desktop noetic branch, thanks again:)

husky_joint_publisher:
  type: "joint_state_controller/JointStateController"
  publish_rate: 50

husky_velocity_controller:
  type: "diff_drive_controller/DiffDriveController"
  left_wheel: ['front_left_wheel', 'rear_left_wheel']
  right_wheel: ['front_right_wheel', 'rear_right_wheel']
  publish_rate: 50
  pose_covariance_diagonal: [0.001, 0.001, 0.001, 0.001, 0.001, 0.03]
  twist_covariance_diagonal: [0.0001, 0.0001, 0.0001, 0.0001, 0.0001, 0.003]
  cmd_vel_timeout: 0.25
  velocity_rolling_window_size: 2

  # Base frame_id
  base_frame_id: base_link

  # Odometry fused with IMU is published by robot_localization, so
  # no need to publish a TF based on encoders alone.
  enable_odom_tf: false

  # Husky hardware provides wheel velocities
  estimate_velocity_from_position: false

  # Wheel separation and radius multipliers
  wheel_separation_multiplier: 1.875 # default: 1.0
  wheel_radius_multiplier    : 1.0 # default: 1.0

  # Velocity and acceleration limits
  # Whenever a min_* is unspecified, default to -max_*
  linear:
    x:
      has_velocity_limits    : true
      max_velocity           : 1.0   # m/s
      has_acceleration_limits: true
      max_acceleration       : 3.0   # m/s^2
  angular:
    z:
      has_velocity_limits    : true
      max_velocity           : 2.0   # rad/s
      has_acceleration_limits: true
      max_acceleration       : 6.0   # rad/s^2

@destogl
Copy link

destogl commented Jan 18, 2022

@narutojxl I see you are using ROS(1). Nevermind then.

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

2 participants