diff --git a/include/crazyflie_cpp/Crazyflie.h b/include/crazyflie_cpp/Crazyflie.h index f397df9..78bda0f 100644 --- a/include/crazyflie_cpp/Crazyflie.h +++ b/include/crazyflie_cpp/Crazyflie.h @@ -776,8 +776,8 @@ class CrazyflieBroadcaster void stop(uint8_t groupMask = 0); - // This is always in relative coordinates - void goTo(float x, float y, float z, float yaw, float duration, uint8_t groupMask = 0); + // using relative = false only makes sense for rare cases such as formation control + void goTo(float x, float y, float z, float yaw, float duration, bool relative = true, uint8_t groupMask = 0); // This is always in relative coordinates void startTrajectory( diff --git a/src/Crazyflie.cpp b/src/Crazyflie.cpp index 48b657f..7e9fd9e 100644 --- a/src/Crazyflie.cpp +++ b/src/Crazyflie.cpp @@ -1246,10 +1246,9 @@ void CrazyflieBroadcaster::stop(uint8_t groupMask) m_connection.send(req); } -// This is always in relative coordinates -void CrazyflieBroadcaster::goTo(float x, float y, float z, float yaw, float duration, uint8_t groupMask) +void CrazyflieBroadcaster::goTo(float x, float y, float z, float yaw, float duration, bool relative, uint8_t groupMask) { - crtpCommanderHighLevelGoToRequest req(groupMask, true, x, y, z, yaw, duration); + crtpCommanderHighLevelGoToRequest req(groupMask, relative, x, y, z, yaw, duration); m_connection.send(req); }