Basically, I have never used Gazebo 0.7
I only know a little about the code of 0.8-pre1 and above.
I will try to upload a helicopter set today (thanks to Domenico) for 0.8


On Thu, Mar 13, 2008 at 2:26 PM, <vaibhavghadiok@gmail.com> wrote:
Just to confirm the update child refers to the update function? I
specify the update rate using the <UpdateRate> tag in the world file.
I am sorry I forgot to mention I am using gazebo 0.7 and not 0.8. in
my sleep deprived state. I was forced to use 0.7 as I was in a hurry
and didn't have the time to export the Avatar Heli model to 0.8.

I could try the simulation in 0.8 as well, if the need arises. I guess
the client and controller file would remain same except the place
where the Helicopter is built in the controller file. I will just make
a box using the xml file and try it on 0.8.

Thats the reason to have an update param in the controllers, to have
some independence from the global updaterate. Is this update param the
second argument to the Get Double function?
I tried changing the the updateTime in the world file to 10 or 100 but
to no avail.

The problem in my case is that I am using a very small delta time to
solve my diff equations. Therefore, the solution to the equations lags
the simulation. Therefore, I resorted to plotting the Helicopter pose
at each time instant, which doesn't work either. The code I used for
plotting is given in the last mail.

How can I make the simulation sleep till new information from the
client side is received?
Maybe in my case a function to start and stop the physics simulation
is needed until and unless I can get by plotting the Helicopter
positions.
 


Where will I find method Simulator::MainLoop.

It is not present in 0.7, I think the main loop should be in the main.c

 

Thanks a lot.

On 3/13/08, Jordi Polo <mumismo@gmail.com> wrote:
> The updateRate is read in the controller, the controller will only call the
> UpdateChild method of your specific controller once each update time. Are
> you sure about the bug of not reading the update rate? Where are you
> specifying the update rate in the XML?
>
> The UpdateChild method receive the update time but doesnt use it.
>
> About synchronizing visuals and anything else, you can see the method
> Simulator::MainLoop and you will see that Gazebo just update everything as
> fast as possible. If physics and rendering are slower it will update slower.
> Thats the reason to have an update param in the controllers, to have some
> independence from the global updaterate.
>
> I dont know if a global updateRate is a good idea it can be as easy as sleep
> till next frame.
>
> Do you think a method to stop physics and restart physics can be useful to
> you?
>
>
>
> On Thu, Mar 13, 2008 at 4:57 AM, Vaibhav Ghadiok <vaibhavghadiok@gmail.com>
> wrote:
>
> > hi
> >
> > I have a set of differential equations for the dynamics of a UAV. They
> > give me the rpy, xyz and their respective rates. I am solving these in my
> > client program and then pass on the velocities (xyz & rpy rates) using
> > playerc_position3d_set_velocity. (I put these equations in the client
> > program and not the controller, because otherwise the UAV model will start
> > falling down as soon as the world file is executed, if it has been
> initiated
> > with 0 velocity. It will have to be initiated with trim conditions. I need
> > stationary UAV's at the beginning.)
> >
> > As the parameters of my model are different from that of the Avatar Heli,
> > this doesn't work too well. Also the update times of the method used to
> > solved the differential equations in the client program (eg. delta time
> for
> > the euler method) and the update time of the visualization is not
> > synchronized) Any suggestions?
> >
> > Anyway, I finally changed the update function of the controller program as
> > given below. Basically I just want to pass the position of the Helicopter
> > from the clent program at each time instant and plot the positions of the
> > Helicopter. This isn't quite working though. Even when I initiate the
> > position of my model at 100, 100, 0 (xyz) using the world file it is shown
> > at 0,0,0.
> >
> > Also, what is the double step passed to the update function, it is never
> > used.
> >
> > void Helicopter::Update(double step)
> > {
> >   GzPose pose;
> >   if (this->world->GetSimTime() - this->updateTime > this->updatePeriod)
> >   {
> >     this->updateTime = this->world->GetSimTime();
> >
> >     this->PositionGetCmd();
> >
> >   // I am passing the positions using playerc_position3d_set_velocity
> >   xxx   = this->position->data->cmd_vel_pos[0];
> >   yyy   = this->position->data->cmd_vel_pos[1];
> >   zzz   = this->position->data->cmd_vel_pos[2];
> >   roll  = this->position->data->cmd_vel_rot[0];
> >   pitch = this->position->data->cmd_vel_rot[1];
> >   yaw   = this->position->data->cmd_vel_rot[2];
> >
> > GzVector pos0  = GzVectorSet(xxx, -yyy, zzz);
> > GzQuatern rot0 = GzQuaternFromEuler(roll, -pitch, -yaw);
> > GzPose pose;
> > this->body->SetPosition(pos0);
> > this->body->SetRotation(rot0);
> > pose.pos = pos0;
> > pose.rot = rot0;
> > // Update the interface
> >     this->PositionPutData(&pose);
> >   }
> >
> >   return;
> > }
> >
> > Another issue is the update rate (the rate at which the update function is
> > called). Changing it in the world file doesn't make a difference but when
> I
> > change the update rate by changing the second parameter of GetDouble
> > function I get lower update times. (Relevant code is given below). I need
> to
> > lower the update time to get smooth plotting of the Helicopter. If it is
> > plotted at 10 times per second, it will be very jerky.
> >
> > this->updatePeriod = 1.0 / (node->GetDouble("updateRate", 10) + 1e-6);
> > this->updateTime = -updatePeriod;
> >
> > Thanks in advance.
> >
> > Vaibhav
> >
> > --
> > http://guidance.aero.iisc.ernet.in/vaibhav
> > -------------------------------------------------------------------------
> > This SF.net email is sponsored by: Microsoft
> > Defy all challenges. Microsoft(R) Visual Studio 2008.
> > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> > _______________________________________________
> > Playerstage-gazebo mailing list
> > Playerstage-gazebo@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/playerstage-gazebo
> >
> >
>
>
> --
> Jordi Polo Carres
> NLP laboratory - NAIST
> http://www.bahasara.org
>


--
Mobile Robotics Laboratory
Guidance, Control and Decision Systems Laboratory
Aerospace Department
Indian Institute of Science, Bangalore



--
Jordi Polo Carres
NLP laboratory - NAIST
http://www.bahasara.org