Gazebo | Ignition | Community
Ask Your Question

How to simulate motors in Gazebo without ROS

asked 2020-07-01 09:07:42 -0500

laura gravatar image

updated 2020-07-01 09:09:21 -0500


I am looking forward to simulate a motor using Gazebo (and I am quite new to it). For now, I only have a revolute joint between two links. But I really need to add some motor characteristics such as

  • nominal torque
  • nominal speed
  • reduction due to training (with a certain ratio)
  • and maybe others ...

For the reduction part I was thinking of using a gearbox joint but when I try to use it, my robot collapses. So I am not sure to really understand how it works.

I saw that it exists using ROS and URDF but I am using only Gazebo and SDF format. Can you help me please ? :)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-07-01 09:34:39 -0500

You can create a model plugin, get access to the joint, and then you can control it by setting its position, velocity, or effort. Within this plugin, you can freely implement your motor interface as you like.

You can use default_robot_hw_sim as a reference. This is where the "ROS motors" are implemented.

edit flag offensive delete link more


thanks for your answer! I am already using a model plugin to do a torque compensation on every updates (because the rotation of one joint leads to the rotation of another one, and i don't want it to move). If i set torque or velocity in my plugin, the joint can't stop rotating. One solution could be to send torque and velocity command when I am sending position command from another library. To take into account reduction due to training, do you know how gearbox joint works or examples pls?

laura gravatar imagelaura ( 2020-07-01 10:44:01 -0500 )edit

You can find a working gearbox joint here. It's loaded in the if you wanna try it.

nlamprian gravatar imagenlamprian ( 2020-07-01 15:32:35 -0500 )edit

Question Tools

1 follower


Asked: 2020-07-01 09:07:42 -0500

Seen: 956 times

Last updated: Jul 01 '20