ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

differences in simulation from gazebo and Matlab

asked 2012-01-23 03:55:41 -0600

maruchi gravatar image

updated 2012-01-23 05:41:56 -0600

Dear,
I have a simple urdf model and have tried to control the model using some nonlinear controller. To verify the controller, I tested it in Matlab simulation. The designed controller worked well in the Matlab environment, but the c++ coded controller has not worked in gazebo. So I made open loop test both in ROS and Matlab, for example, applied unit force and moment to the model and checked the outputs of positions and velocities. The values from the gazebo simulation is far smaller than those from Matlab. What should I modify or check in gazebo simulation ? I checked mass properties, put viscous damping (modeled using feedback velocity), used the time from ros::Time::now().toSec().

Is this problem related to time in gazebo?

edit retag flag offensive close merge delete

Comments

Hi Maruchi, can you post instructions on how to reproduce the results? thanks. John
hsu gravatar image hsu  ( 2012-01-23 05:51:36 -0600 )edit
If you mean reproducing in matlab, I made a model and designed a controller in matlab/simulink. To verify that the model in matlab/simulink is same as the model in gazebo, I did open loop test such as step response test and see those responses are same each other.
maruchi gravatar image maruchi  ( 2012-01-23 12:02:37 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2012-01-23 12:04:19 -0600

maruchi gravatar image
Stefan, I was able to correct the problem of inconsistency between the model in matlab/simulink and gazebo by using the same frequency in the ODE and publishing force and moment in gazebo.
edit flag offensive delete link more
0

answered 2012-01-23 05:13:13 -0600

I'm not quite sure I understand you correctly, but are you using two different simulation systems for dynamics simulation? Gazebo uses ODE of course, but what are you using for matlab? Realtime dynamics simulation is hard and often quite sensitive to numerical problems/integrator settings etc.

Also, in case you use the gazebo_ros_force plugin, be aware of this issue.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-01-23 03:55:41 -0600

Seen: 1,882 times

Last updated: Jan 23 '12