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

How to set the Effort while using JointGroupVelocityController in Gazebo #276

Open
alextdbc opened this issue Feb 1, 2024 · 3 comments
Open
Labels
enhancement New feature or request

Comments

@alextdbc
Copy link

alextdbc commented Feb 1, 2024

Hello, im using the JointGroupVelocityController to control a 4-wheeled-robot. Each of these wheels is connected to the body by an robot arm, which an rotate to lift the body up and down.

I want to create a simulation in Gazebo and control the arms with the velocity controller. For now i can control the velocity of the arms but when i want to lift the body by rotating the arm into the ground, the arms stop rotating, instead of lifting up the body. It seems like there is not enough torque. My effort limit is set to "10000", but when i am subscribing to the /robot_states-topic the effort is always zero.

So my question is, in which way i can set the effort for velocity control to lift the robot body with the velocity controller?

Hopefully i can find some help here.

@alextdbc alextdbc added the enhancement New feature or request label Feb 1, 2024
@christophfroehlich christophfroehlich transferred this issue from ros-controls/ros2_controllers Feb 1, 2024
@christophfroehlich
Copy link
Contributor

I moved this issue to gazebo_ros2_control, because this is more a question of simulation than ros2_controllers. (I assumed you mean gazebo classic instead of gazebo? If not, I'll move it to gz_ros2_control).

If you use a velocity command interface with gazebo_ros2_control, then the velocity of the physics engine is "overwritten" and no effort is calculated, hence the state interface given back reads zero. But velocity interface is de-facto standard for wheeled robots, this should not be the problem here.

Have you tried to move the robot around by manually applying a force from the GUI? If this works (and you haven't accidentally fixed the robot in the world frame), then try to use a effort_controllers/JointGroupEffortController for one arm, apply the effort and see what happens.

@alextdbc
Copy link
Author

alextdbc commented Feb 1, 2024

Hi thank you for your answer. Youre right im using Gazebo classic.

My robot is not fixed to the world frame and i can move it around. I already tried to use the JointTrajectoryController to set the goal position and that worked completely fine. Now i've tried it with the EffortController and that worked also. Just when im using the VelocityController the Wheels and Arm arent spinning as soon as they get contact with the Ground.

@christophfroehlich
Copy link
Contributor

This is a drawback of the implementation with writing position or velocity values to the physics engine, see #240 for a similar issue.
To overcome this, I'd suggest to write an own gazebo plugin, exposing velocity interfaces to your controller but writing effort to the joints in the simulation loop. In between you can use a high-gain PID controller or similar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants