Hello, I had cmake 16.3 installed on my jetso device. I installed cmake 19.3.0 for mavsdk and tried to compile mavsdk, but I get the error below. Can you help me with this?
@JulianOes
– All plugins enabled
– BUILD_MAVSDK_SERVER not set: not building grpc mavsdk_server
– Configuring done
CMake Error at src/integration_tests/CMakeLists.txt:5 (add_executable):
Target “integration_tests_runner” links to target “GTest::gmock” but the
target was not found. Perhaps a find_package() call is missing for an
IMPORTED target, or an ALIAS target is missing?
CMake Error at src/unit_tests/CMakeLists.txt:3 (add_executable):
Target “unit_tests_runner” links to target “GTest::gmock” but the target
was not found. Perhaps a find_package() call is missing for an IMPORTED
target, or an ALIAS target is missing?
CMake Error at src/system_tests/CMakeLists.txt:1 (add_executable):
Target “system_tests_runner” links to target “GTest::gmock” but the target
was not found. Perhaps a find_package() call is missing for an IMPORTED
target, or an ALIAS target is missing?
– Generating done
CMake Generate step failed. Build files cannot be regenerated correctly.
Thanks for your feedback, yes I was able to build it this way. Now I am facing a new problem. I have a code that I tried to read rc channels with mavsdk. With this code I can get channel values with stil(arducopter) but when I connect to a real system and run the code
Request message 242 again using REQUEST_MESSAGE (retries: 1) (mavlink_request_message.cpp:75)
[11:30:59|Debug] MAVLink: info: EKF3 IMU1 tilt alignment complete (system_impl.cpp:243)
[11:30:59|Debug] MAVLink: info: EKF3 IMU0 tilt alignment complete (system_impl.cpp:243)
[11:31:00|Warn ] Request message 242 again using REQUEST_MESSAGE (retries: 2) (mavlink_request_message.cpp:75)
[11:31:01|Warn ] Request message 242 again using REQUEST_MESSAGE (retries: 3) (mavlink_request_message.cpp:75)
[11:31:04|Debug] Request message 242 using REQUEST_MESSAGE (mavlink_request_message.cpp:78)
[11:31:05|Warn ] Request message 242 again using REQUEST_MESSAGE (retries: 1) (mavlink_request_message.cpp:75)
I’m getting this message
“”"
auto system = mavsdk.first_autopilot(3.0);
if (!system) {
cerr << “Timed out waiting for system\n”;
return 1;
}
Telemetry telemetry{system.value()};
MavlinkPassthrough mavlink_passthrough{system.value()};
mavlink_passthrough.subscribe_message(
MAVLINK_MSG_ID_RC_CHANNELS,
[](const mavlink_message_t& message) {
mavlink_rc_channels_t channel_output;
mavlink_msg_rc_channels_decode(&message, &channel_output);
cout << "RC Kanal 8: " << channel_output.chan8_raw << endl;
int leptonChannelValue = channel_output.chan8_raw;
checkLeptonStatus(leptonChannelValue);
});
while (true) {
this_thread::sleep_for(std::chrono::seconds(1));
}"""
This is my code that I tried to read mavlink messages. I would be very happy if you could help me, thanks in advance.
You can ignore the request message warnings. That just means that MAVSDK wasn’t able to request certain messages.
Thank you for your feedback and help. But I can’t read or see the RC channel values. My aim is to read the values of the RC channels and perform operations accordingly, but since I can’t read the value of the RC channel, I can’t perform the operation. I wonder if there is a deficiency in my code. I’m not sure.
Are RC messages actually sent out? If not, you will have to enable this.
I don’t know how this is generally done for ArduPilot, but you can try to send this command (also via mavlink_passthrough):