Is there a way to use URDF/Gazebo with a custom dynamic model?

asked 2019-12-25 23:08:32 -0600

alexglz gravatar image

I have the dynamic model of a robot, where I use two custom float inputs to represent each of the two thrusters. The model outputs an odometry msg, and I use a tf broadcaster to display the translation in rviz, which works correctly given the thrusters' values.

However, I would like to know if there's a way that I can use this model with an urdf model either in rviz or Gazebo. I have the STL file of the urdf file, I mainly which to first display the urdf file on Gazebo and use the tf/odom msgs to visualize the movement of the robot. After this, I plan on implementing different sensors (camera, lase-rscan) to test other algorithms. I am not looking to create a urdf file with joints as in the tutorials, as all of the vehicle dynamics (except external disturbances) are already represented in the model.

Thank you.

edit retag flag offensive close merge delete

Comments

Since you say that your robot does not have joints, you can simply create a "single-link" URDF with the STL mesh as visual. Loading it into Gazebo will not be a problem even without joints (provided that you properly set inertial properties), and you should be able to simulate the thrusters by applying some forces on the body. Would that be enough or are you looking for something else? In particular, when you say that you know the dynamic model, do you mean that you know the mass and inertia or something else, e.g., you have an aircraft for which you use special dynamic equations?

ffusco gravatar imageffusco ( 2019-12-26 13:55:32 -0600 )edit

I mean something closer to the second. I have the dynamic equations of a surface vehicle, and I am looking for ways to use these dynamic equations in the gazebo environment, first for visualization (which the single link may be useful for, thank you), and then to implement sensors on the URDF file to test algorithms with the whole system on the loop.

alexglz gravatar imagealexglz ( 2019-12-26 15:45:54 -0600 )edit

Is it a wheeled vehicle? In that case, you might try to create a "normal" URDF (with continuous joints for the wheels) and check if the dynamics matches your equations - it would seem faster and easier to me, but I never played with mobile robots in Gazebo and therefore I could be wrong!

ffusco gravatar imageffusco ( 2019-12-27 14:22:56 -0600 )edit

Anyway, to implement your custom dynamics I believe that a model plugin would do the job just fine. Perhaps you can check in Gazebo's website/forum if anyone has implemented something similar before!

ffusco gravatar imageffusco ( 2019-12-27 14:24:55 -0600 )edit

It is a boat, so no wheels haha. Thank you for your help! I'll look into plugins and some other simulators out there (which I haven't researched how they work).

alexglz gravatar imagealexglz ( 2020-01-03 03:59:52 -0600 )edit