Hello All,
I'm a newbie to libgazebo and trying to figure out the best way of driving
an aircraft model in gazebo through an external aviation simulator. I'm not
using player, since we use (IMHO) a more flexible device server (MIRO, for
those that are interested), so I'm talking directly to libgazebo. I've tried
a few experiments setting positions, which works...sort of. If I set
position directly, I get odd results that makes me think I'm fighting ODE.
Basically, I just want to feed the aircraft state directly to a plugin
model. I noticed that in the AvatarHeli model, the following approach is
used in AvatarHeli::PositionGetCmd():
void AvatarHeli::PositionGetCmd()
{
gz_position_lock(this->position, 1);
this->cmdLinVel = GzVectorSet(this->position->data->cmd_vel_pos[0],
this->position->data->cmd_vel_pos[1],
this->position->data->cmd_vel_pos[2]);
this->cmdAngVel = GzVectorSet(this->position->data->cmd_vel_rot[0],
this->position->data->cmd_vel_rot[1],
this->position->data->cmd_vel_rot[2]);
gz_position_unlock(this->position);
return;
}
and then in Update():
this->PositionGetCmd();
// Rotate velocities into global cs
pose = this->GetPose();
lv = GzCoordPositionAdd(this->cmdLinVel, GzVectorSet(0, 0, 0),
pose.rot);
av = GzCoordPositionAdd(this->cmdAngVel, GzVectorSet(0, 0, 0),
pose.rot);
// Dumb controller
this->body->SetLinearVel(lv);
this->body->SetAngularVel(av);
...which is a 'back door' method of setting the state. Over the long haul
the position within the external simulator and gazebo would diverge using
this method. A similar technique is used in Blimp. So the question is: " Is
there a way of directly setting the state of an actor in libgazebo other
than through derivative terms?"
Simon
--
View this message in context:
http://www.nabble.com/External-simulators-and-Gazebo-tf4337753.html#a12355928
Sent from the playerstage-gazebo mailing list archive at Nabble.com.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Playerstage-gazebo mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-gazebo