Skip to content

Commit

Permalink
fix bugs and add unreal position to the report info.
Browse files Browse the repository at this point in the history
  • Loading branch information
lovettchris committed Mar 1, 2017
1 parent 5c64816 commit c1cb4a6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
7 changes: 3 additions & 4 deletions AirLib/include/common/StateReporter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,9 @@ class StateReporter {
real_T pitch, roll, yaw;
VectorMath::toEulerianAngle(quat, pitch, roll, yaw);

ss_ << name << ": " <<
"(" << roll << ", " << pitch << ", " << yaw << ") -" <<
" [" << quat.w() << ", " <<
quat.x() << ", " << quat.y() << ", " << quat.z() << "]\n";
ss_ << name << ":\n" <<
" euler: (" << roll << ", " << pitch << ", " << yaw << ")\n" <<
" quat: [" << quat.w() << ", " << quat.x() << ", " << quat.y() << ", " << quat.z() << "]\n";
}

//write APIs - generic values
Expand Down
2 changes: 0 additions & 2 deletions AirLib/src/rpc/RpcLibServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ struct RpcLibServer::impl {
{}

~impl() {
server.close_sessions();
}

rpc::server server;
Expand Down Expand Up @@ -121,7 +120,6 @@ void RpcLibServer::start(bool block)
void RpcLibServer::stop()
{
pimpl_->server.stop();
pimpl_->server.close_sessions();
}

}} //namespace
Expand Down
5 changes: 5 additions & 0 deletions Unreal/Plugins/AirSim/Source/MavMultiRotorConnector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,12 @@ void MavMultiRotorConnector::update(real_T dt)

void MavMultiRotorConnector::reportState(StateReporter& reporter)
{
// report actual location in unreal coordinates so we can plug that into the UE editor to move the drone.
FVector unrealPosition = vehicle_pawn_->getPosition();
reporter.writeValue("unreal pos", AVehiclePawnBase::toVector3r(unrealPosition, 1.0f, false));

vehicle_.reportState(reporter);

}

MavMultiRotorConnector::UpdatableObject* MavMultiRotorConnector::getPhysicsBody()
Expand Down

0 comments on commit c1cb4a6

Please sign in to comment.