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

Model Sliding in Gazebo #20

Open
lukasehr opened this issue Jul 5, 2024 · 18 comments
Open

Model Sliding in Gazebo #20

lukasehr opened this issue Jul 5, 2024 · 18 comments

Comments

@lukasehr
Copy link

lukasehr commented Jul 5, 2024

Hey there, under known bugs, it says there is a problem with ros2 ctrl pkg which makes the robot slide on the ground. I also experience that issue. Has there been any updates relating that problem. Is there a way to fix it? I've seen under the closed issues that someone might have fixed it, are those changes already adapted?

@NDHANA94
Copy link
Owner

NDHANA94 commented Jul 6, 2024

Hi,
No unfortunately,
I'm planning to update the repo soon with PyBullet simulation. PyBullet has no this issue.

@lukasehr
Copy link
Author

lukasehr commented Jul 6, 2024

Oh okay. Do you think it is fixable with Gazebo aswell? I mean there are other gait generators without that issue in gazebo. Is it a problem with the feedforwardcontroller?

My prof said I have to make it work in gazebo for the bachelor thesis. However I was not successful so far and if you say it is unfixable I have to talk to him again concerning that problem.

Thanks a lot for the answer!

@NDHANA94
Copy link
Owner

NDHANA94 commented Jul 6, 2024

We tried everything possible to fix the issue. Still the situation is the same. There are more legged robots working on gazebo, yes. However, they are using ROS1. ROS1 gazebo control plugin has no this issue. Ros 2 gazebo control plugin has no option to change the PID gains of joints, this is the issue causing this slipperiness.

@NDHANA94
Copy link
Owner

NDHANA94 commented Jul 6, 2024

With that being said, you can try to create a ROS1 PKG to run the simulation using ROS1 control plugin. And use Ros bridge to send joint angles to the simulation

@NDHANA94
Copy link
Owner

NDHANA94 commented Jul 6, 2024

Well, maybe latest version of ros2 gazebo control plugin has already solved this issue. I haven't checked them. U can give it a shot and let me know as well.

@lukasehr
Copy link
Author

lukasehr commented Jul 6, 2024

So I am trying to make the hyperdog gaitgen as well as the champ gaitgen work in Ros2 with Gazebo11. The Champ gaitgen is actually working pretty well. My idea was to compare the two and find if there are some significant differences, but so far I was not successfull. In champ, there is actually a way to change the PID values, here is the .yaml file of it:

Champ Gaitgen

controller_manager:
ros__parameters:
use_sim_time: True
update_rate: 250 # Hz

joint_states_controller:
  type: joint_state_controller/JointStateBroadcaster

joint_state_broadcaster:
  type: joint_state_broadcaster/JointStateBroadcaster     

joint_group_effort_controller:
  type: joint_trajectory_controller/JointTrajectoryController 

joint_group_effort_controller:
ros__parameters:
use_sim_time: True
joints:
- front_left_shoulder
- front_left_leg
- front_left_foot
- front_right_shoulder
- front_right_leg
- front_right_foot
- rear_left_shoulder
- rear_left_leg
- rear_left_foot
- rear_right_shoulder
- rear_right_leg
- rear_right_foot
command_interfaces:
- effort
state_interfaces:
- position
- velocity

gains:
  front_left_shoulder :   {p: 100.0, i: 0.2, d: 1.0, i_clamp: 2.5, ff_velocity_scale: 1.0}
  front_left_leg      :   {p: 100.0, i: 0.2, d: 1.0, i_clamp: 2.5, ff_velocity_scale: 1.0}
  front_left_foot     :   {p: 100.0, i: 0.2, d: 1.0, i_clamp: 2.5, ff_velocity_scale: 1.0}
  front_right_shoulder:   {p: 100.0, i: 0.2, d: 1.0, i_clamp: 2.5, ff_velocity_scale: 1.0}
  front_right_leg     :   {p: 100.0, i: 0.2, d: 1.0, i_clamp: 2.5, ff_velocity_scale: 1.0}
  front_right_foot    :   {p: 100.0, i: 0.2, d: 1.0, i_clamp: 2.5, ff_velocity_scale: 1.0}
  rear_left_shoulder  :   {p: 100.0, i: 0.2, d: 1.0, i_clamp: 2.5, ff_velocity_scale: 1.0}
  rear_left_leg       :   {p: 100.0, i: 0.2, d: 1.0, i_clamp: 2.5, ff_velocity_scale: 1.0}
  rear_left_foot      :   {p: 100.0, i: 0.2, d: 1.0, i_clamp: 2.5, ff_velocity_scale: 1.0}
  rear_right_shoulder :   {p: 100.0, i: 0.2, d: 1.0, i_clamp: 2.5, ff_velocity_scale: 1.0}
  rear_right_leg      :   {p: 100.0, i: 0.2, d: 1.0, i_clamp: 2.5, ff_velocity_scale: 1.0}
  rear_right_foot     :   {p: 100.0, i: 0.2, d: 1.0, i_clamp: 2.5, ff_velocity_scale: 1.0}
allow_nonzero_velocity_at_trajectory_end: True

@lukasehr
Copy link
Author

lukasehr commented Jul 6, 2024

I mean it would be very cool if hyperdog would work, do you think with that information it is possible to fix or no? Is it possible that not the whole ros2 gazebo control is bugged, but only the
gazebo_joint_controller:
type: forward_command_controller/ForwardCommandController

?

@NDHANA94
Copy link
Owner

NDHANA94 commented Jul 6, 2024

Great, I'll try to fix it. Gimme a couple of days. I'll write to you if I'll nailed it))

@lukasehr
Copy link
Author

lukasehr commented Jul 6, 2024

Wow that would be soo dope! I am honestly devasted as I have to make it work but I have no more ideas how to do so :( If I can help you somehow, please let me know!

@TharitSinsunthorn
Copy link

@lukasehr I think it's a setting up of urdf also, you need to tune the physics properties carefully. I have tried to use this repo before with another legged robot URDF, in my case unitree can walk on the gazebo. I'm also beginner on this, but in my opinion, try to adjust the friction of the gazebo tag and ros2 control parameters. Also, I'm not sure about the effect of the .dae mesh, but I have heard that .dae is better if you want to do the physics simulation with collision geometry.

@NDHANA94 If you have any comment, please guide me as well. Anyway thank you very much for you great work!

@lukasehr
Copy link
Author

lukasehr commented Jul 8, 2024

@TharitSinsunthorn i tried playing around with the friction settings (mu1 & mu2), I wasn’t really successful with that. Which ros2 control Parameters do you mean, will give it a try 👍

thanks for the suggestions!

@TharitSinsunthorn
Copy link

As you gave the example from champ. Im also using joint_trajectory_controller in humble. I tried to tune the PID value and some how it fix the sliding problem. Here is some of my yaml file

`RFposition_trajectory_controller:
ros__parameters:
joints:
- j_c1_rf
- j_thigh_rf
- j_tibia_rf

command_interfaces:
  - effort

state_interfaces:
  - position
  - velocity

state_publish_rate: 50.0 # Hz, Defaults to 50
action_monitor_rate: 20.0 # Hz, Defaults to 20

allow_partial_joints_goal: false # Defaults to false
open_loop_control: true
allow_integration_in_goal_trajectories: true
constraints:
  stopped_velocity_tolerance: 0.01 # Defaults to 0.01
  goal_time: 0.0 # Defaults to 0.0 (start immediately)

gains:
  j_c1_rf:
      p: 2700.0
      i: 12.0
      d: 3.0
  
  j_thigh_rf:
      p: 2700.0
      i: 12.0
      d: 3.0
  
  j_tibia_rf:
      p: 2700.0
      i: 12.0
      d: 3.0`

@diego112891
Copy link

@lukasehr where you able to resolve the issue?

@Robotmaniac8
Copy link

I have the same issue with my robot (check video). It is just sliding in gazebo and i dont understand why this happens. Maybe one of you guys were able to fix this issue and could help me out.
Screencast from 28-10-2024 21:00:48.webm

When i remove the gazebo ros2 plugin :

then the robots does not slide and just fells down (expected) however i cannot control the robot then. Does anybody maybe had the same issue and was able to solve this ?

@TharitSinsunthorn
Copy link

@Robotmaniac8 Can you tell me more about your setup? which ros version are you using, controller, config files, etc.

@Robotmaniac8
Copy link

@TharitSinsunthorn thank you for your quick response.
My Specs are :

Ubuntu 22.04 Jelly
ROS2 Humble
Gazebo Classic

My urdf and other files can you find in this workspace: bysensesim_ws_V2.zip

@TharitSinsunthorn
Copy link

Thank you for your information, as I have observed your package,

first, your control.yaml, you are using position controller but your parameters are for joint_trajectory_controller. You can fix this by changing the type: position_controllers/JointGroupPositionController to type: joint_trajectory_controller/JointTrajectoryController

By this, let's see if it can solve some of your problems. From my experiences, I guess that using position for the command_interface may cause some weird behavior inside the Gazebo. If you face this problem, please try to change from position to effort instead.

I hope this can help you :)

@Robotmaniac8
Copy link

@TharitSinsunthorn thank you for looking threw my package. The last couple days i tried some stuff out to make it work but unfortunately i still have the same issue.
In the control.yaml file i changed the position controller to joint_trajectory_controller and accomplished that the controller is loaded inside gazebo.
However it is still sliding like an ice hocker player.

-I tried to change the command_interface from position to effort and changed the urdf accordingly aswell. However in the terminal i got the error that "joint_trajectory_controller" does not work with effort as command interface only [postion, velocity and acceleration]. Do you know how to change to effort ?

-I played with the pid values and added extra friction into the world file aswell but no progress.
:(

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

5 participants