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

Add flipper torque limit control #948

Merged
merged 5 commits into from
Nov 16, 2021
Merged

Conversation

peci1
Copy link
Collaborator

@peci1 peci1 commented Jun 2, 2021

This PR implements the so-far-missing support for torque limit control for robots with flippers. Having this allows making much better controllers.

Depends on gazebosim/gz-sim#847, gazebosim/gz-physics#260 and maybe gazebo-forks/dart#26 .

The code explicitly checks if the torque limit isn't larger than the <joint effort=""> attribute in SDF, so it shouldn't be possible to create unrealistically strong flippers.

How to test:

LANG=C ign launch -v4 competition.ign robotName1:=X1 robotConfig1:=CTU_CRAS_NORLAB_MARV_SENSOR_CONFIG_1 worldName:=simple_cave_01 circuit:=cave

rostopic pub -1 /X1/flippers_cmd_pos/front_right std_msgs/Float64 "data: 1.0" &
rostopic pub -1 /X1/flippers_cmd_pos/front_left std_msgs/Float64 "data: 1.0" &
rostopic pub -1 /X1/flippers_cmd_pos/rear_right std_msgs/Float64 "data: -1.0" &
rostopic pub -1 /X1/flippers_cmd_pos/rear_left std_msgs/Float64 "data: -1.0" &

# the robot should stand up

sleep 10

rostopic pub -1 /X1/flippers_cmd_max_torque/front_right std_msgs/Float64 "data: 2.0" &
rostopic pub -1 /X1/flippers_cmd_max_torque/front_left std_msgs/Float64 "data: 2.0" &

# front flippers should lay down

sleep 10

rostopic pub -1 /X1/flippers_cmd_max_torque/front_right std_msgs/Float64 "data: 200.0" &
rostopic pub -1 /X1/flippers_cmd_max_torque/front_left std_msgs/Float64 "data: 200.0" &

# it should stand up again

@peci1
Copy link
Collaborator Author

peci1 commented Jun 2, 2021

flipper_torque.mp4.mp4

@peci1
Copy link
Collaborator Author

peci1 commented Nov 15, 2021

I've updated this PR with master branch. I also added validTopic() calls around the parsed custom topic names. Last, I also added a new topic for configuring the maximum velocity used for achieving positional commands. By default, the maximum joint velocity is used.

@azeey azeey mentioned this pull request Nov 15, 2021
6 tasks
Copy link
Member

@azeey azeey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me. Only one comment about avoiding race conditions.

@azeey azeey merged commit 78bb235 into osrf:master Nov 16, 2021
@chapulina chapulina mentioned this pull request Dec 21, 2021
7 tasks
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

Successfully merging this pull request may close these issues.

2 participants