Skip to content

Commit

Permalink
OSDK 3.6.1: Fix M100 issues with OSDK 3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Rohit Sant committed Feb 16, 2018
1 parent a7ca501 commit 985abe5
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 19 deletions.
41 changes: 24 additions & 17 deletions osdk-core/api/src/dji_vehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ Vehicle::functionalSetUp()
*/
if (!initSubscriber())
{
DERROR("Subscriber not supported!\n");
DERROR("Failed to initialize subscriber!\n");
return 1;
}

Expand All @@ -167,7 +167,7 @@ Vehicle::functionalSetUp()
*/
if (!initBroadcast())
{
DERROR("Broadcast not supported!\n");
DERROR("Failed to initialize Broadcast!\n");
return 1;
}

Expand All @@ -176,7 +176,7 @@ Vehicle::functionalSetUp()
*/
if (!initControl())
{
DERROR("Control not supported!\n");
DERROR("Failed to initialize Control!\n");
return 1;
}

Expand All @@ -196,7 +196,7 @@ Vehicle::functionalSetUp()
*/
if (!initMFIO())
{
DSTATUS("MFIO not supported!\n");
DERROR("Failed to initialize MFIO!\n");
return 1;
}

Expand All @@ -217,13 +217,14 @@ Vehicle::functionalSetUp()

if (!initHardSync())
{
DERROR("Hardware Sync not supported!\n");
DERROR("Failed to initialize HardSync!\n");
return 1;
}

if (!initVirtualRC())
{
DSTATUS("Virtual RC not supported!\n");
DERROR("Failed to initiaze VirtualRC!\n");
return 1;
}

#ifdef ADVANCED_SENSING
Expand Down Expand Up @@ -734,7 +735,7 @@ Vehicle::initSubscriber()
}
else
{
return false;
DSTATUS("Telemetry subscription mechanism is not supported on this platform!\n");
}

return true;
Expand All @@ -760,7 +761,7 @@ Vehicle::initBroadcast()
}
else
{
return false;
DSTATUS("Telemetry broadcast is not supported on this platform!\n");
}

return true;
Expand All @@ -786,7 +787,7 @@ Vehicle::initControl()
}
else
{
return false;
DSTATUS("Control functionalities are not supported on this platform!\n");
}

return true;
Expand Down Expand Up @@ -893,7 +894,7 @@ Vehicle::initGimbal()
DSTATUS("Gimbal not mounted!\n");
}

return false;
return true;
}

#ifdef ADVANCED_SENSING
Expand Down Expand Up @@ -937,7 +938,7 @@ Vehicle::initMFIO()
}
else
{
return false;
DSTATUS("MFIO is not supported on this platform!\n");
}

return true;
Expand Down Expand Up @@ -973,7 +974,9 @@ Vehicle::initMissionManager()

this->missionManager = new (std::nothrow) MissionManager(this);
if (this->missionManager == 0)
{
return false;
}

return true;
}
Expand All @@ -994,11 +997,13 @@ Vehicle::initHardSync()
{
return false;
}

return true;
}
else
{
DSTATUS("Hardware Sync is not supported on this platform!\n");
}

return false;
return true;
}

bool
Expand All @@ -1018,11 +1023,13 @@ Vehicle::initVirtualRC()
DERROR("Error creating Virtual RC!");
return false;
}

return true;
}
else
{
DERROR("Virtual RC is not supported on this platform!\n");
}

return false;
return true;
}

bool
Expand Down
4 changes: 2 additions & 2 deletions sample/linux/flight-control/flight_control_sample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ monitoredTakeoff(Vehicle* vehicle, int timeout)

do
{
sleep(3);
sleep(4);
currentHeight = vehicle->broadcast->getGlobalPosition();
delta = fabs(currentHeight.altitude - deltaHeight.altitude);
deltaHeight.altitude = currentHeight.altitude;
Expand Down Expand Up @@ -900,4 +900,4 @@ bool startGlobalPositionBroadcast(Vehicle* vehicle)
{
return true;
}
}
}

0 comments on commit 985abe5

Please sign in to comment.