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 <[EMAIL PROTECTED]>
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
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/playerstage-gazebo
>
>


-- 
Jordi Polo Carres
NLP laboratory - NAIST
http://www.bahasara.org
-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-gazebo

Reply via email to