Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discrepancy between Documentation and Example #2221

Open
RizzwareEngineer opened this issue Feb 14, 2024 · 3 comments
Open

Discrepancy between Documentation and Example #2221

RizzwareEngineer opened this issue Feb 14, 2024 · 3 comments

Comments

@RizzwareEngineer
Copy link

I have the following basic CMakeLists.txt for my C++ code that makes use of the Telemetry API.

CMakeLists.txt
cmake_minimum_required(VERSION 3.15)
project(telemetry-stream)

# Set the C++ standard
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Enable strict handling of warnings
add_definitions("-Wall -Wextra -Werror")

# Find MAVSDK package
find_package(MAVSDK REQUIRED)

# Add executable target with source files
add_executable(telemetry-stream main.cpp)

# Link MAVSDK library
target_link_libraries(telemetry-stream
  MAVSDK::mavsdk
)
Output
-- Configuring done (0.1s) CMake Error at CMakeLists.txt:18 (target_link_libraries): Target "telemetry-stream" links to:
MAVSDK::mavsdk_telemetry
but the target was not found. Possible reasons include:

* There is a typo in the target name.
* A find_package call is missing for an IMPORTED target.
* An ALIAS target is missing.
-- Generating done (0.0s)
CMake Generate step failed. Build files cannot be regenerated correctly.

According to this documentation, MAVSDK::mavsdk_telemetry is needed within the target_link_libraries call.

However, this following example's source code which makes use of Telemetry does NOT include MAVSDK::mavsdk_telemetry within the target_link_libraries call.

If I delete MAVSDK::mavsdk_telemetry, I am able to build and execute.

However, I wanted to ask: why there is a discrepancy between the documentation and the example, and which I should follow?

@JonasVautherin
Copy link
Collaborator

With recent versions of MAVSDK, you only need MAVSDK::mavsdk. It appears that the documentation is outdated here.

Would you be willing to open a PR and correct the documentation? That would be highly appreciated 🙃.

@RizzwareEngineer
Copy link
Author

I would love to! Will do :)

@julianoes
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants