Skip to content

Commit

Permalink
resolve compile warnings, fix issue microsoft#411
Browse files Browse the repository at this point in the history
  • Loading branch information
sytelus committed Aug 14, 2017
1 parent 6a4f3fb commit 3aa4195
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 12 deletions.
3 changes: 3 additions & 0 deletions AirLib/include/common/StateReporterWrapper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ class StateReporterWrapper : public UpdatableObject {
}
virtual void reportState(StateReporter& reporter) override
{
//TODO: perhaps we should be using supplied reporter?
unused(reporter);

//write dt stats
report_.writeNameOnly("dt");
report_.writeValueOnly(dt_stats_.mean());
Expand Down
1 change: 1 addition & 0 deletions AirLib/include/physics/PhysicsEngineBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class PhysicsEngineBase : public UpdatableObject {

virtual void reportState(StateReporter& reporter) override
{
unused(reporter);
//default nothing to report for physics engine
}

Expand Down
5 changes: 2 additions & 3 deletions AirLib/include/physics/PhysicsWorld.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class PhysicsWorld {
{
enableStateReport(state_reporter_enabled);
update_period_nanos_ = update_period_nanos;
initializeWorld(physics_engine, bodies, start_async_updator);
initializeWorld(bodies, start_async_updator);
}

void lock()
Expand Down Expand Up @@ -77,8 +77,7 @@ class PhysicsWorld {
}

private:
void initializeWorld(PhysicsEngineBase* physics_engine,
const std::vector<UpdatableObject*>& bodies, bool start_async_updator)
void initializeWorld(const std::vector<UpdatableObject*>& bodies, bool start_async_updator)
{
reporter_.initialize(false);
world_.insert(&reporter_);
Expand Down
3 changes: 3 additions & 0 deletions AirLib/include/physics/World.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ class World : public UpdatableContainer<UpdatableObject*> {
//async updater thread
void startAsyncUpdator(uint64_t period)
{
//TODO: probably we shouldn't be passing around fixed period
executor_.initialize(std::bind(&World::worldUpdatorAsync, this, std::placeholders::_1), period);
executor_.start();
}
Expand All @@ -109,6 +110,8 @@ class World : public UpdatableContainer<UpdatableObject*> {
private:
bool worldUpdatorAsync(uint64_t dt_nanos)
{
unused(dt_nanos);

try {
update();
}
Expand Down
18 changes: 9 additions & 9 deletions PythonClient/PythonClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,28 +97,28 @@ def simGetImage(self, camera_id, image_type):
# helper method for converting getOrientation to roll/pitch/yaw
# https://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles
def toEulerianAngle(self, q):
x = q[0]
z = q[0]
y = q[1]
z = q[2]
x = q[2]
w = q[3]
ysqr = y * y;

# roll (x-axis rotation)
t0 = -2.0* (ysqr + z * z) + 1.0;
t1 = +2.0* (x * y + w * z);
roll = math.atan2(t1, t0)
t0 = +2.0 * (w*x + y*z);
t1 = +1.0 - 2.0*(x*x + ysqr);
roll = math.atan2(t0, t1)

# pitch (y-axis rotation)
t2 = -2.0* (x * z - w * y);
t2 = +2.0 * (w*y - z*x);
if (t2 > 1.0):
t2 = 1
if (t2 < -1.0):
t2 = -1.0
pitch = math.sin(t2)
pitch = math.asin(t2)

# yaw (z-axis rotation)
t3 = +2.0* (y * z + w * x);
t4 = -2.0* (x * x + ysqr) + 1.0;
t3 = +2.0 * (w*z + x*y);
t4 = +1.0 - 2.0 * (ysqr + z*z);
yaw = math.atan2(t3, t4)

return (pitch, roll, yaw)
Expand Down

0 comments on commit 3aa4195

Please sign in to comment.