-
Notifications
You must be signed in to change notification settings - Fork 14.5k
Added driver support for Anello X3 IMU. #25724
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
base: main
Are you sure you want to change the base?
Conversation
what is this? Please provide a description and context. Also this must be enabled somehow in the build. Is there a target using this? The code doesn't look like it's following the conventions of other drivers. |
Hello, I added a short description and some context to what this driver code is for. Currently there are no targets using/enabling this driver (yet), but it can be enabled by defining "CONFIG_DRIVERS_IMU_ANELLO_X3=y" in the specific board default.px4board or other *.px4board configuration file much like any other driver. Please let me know if more context is needed. As for driver conventions, there were some corrections to the code to match up with coding conventions and the driver is setup much like other drivers in that there are "start" and "stop" commands to kick-off and stop the driver. What other conventions need to be followed? (I will also take a look at the other drivers to see what else needs to be changed for this X3 driver). Thank you, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you share a link to the datasheet in the description? Can you also share some flight logs once this is ready and comment on the level of testing
@@ -0,0 +1,268 @@ | |||
/**************************************************************************** | |||
* | |||
* Copyright (c) 2023 PX4 Development Team. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Copyright (c) 2023 PX4 Development Team. All rights reserved. | |
* Copyright (c) 2025 PX4 Development Team. All rights reserved. |
printf("state @ %p\n", g_dev); | ||
g_dev->print_info(); | ||
|
||
return 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return 0; | |
return PX4_OK; |
return PX4_OK; | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whitespace, take another pass on the formatting and run make format
before committing
const char *device_path = nullptr; | ||
int myoptind = 1; | ||
const char *msg = nullptr; | ||
const char *myoptarg = "/dev/ttyUSB0"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
USB?
#include <poll.h> | ||
|
||
// /dev/serial/by-id/usb-FTDI_TTL232R-3V3_FTGCVVU0-if00-port0 -> ../../ttyUSB1 | ||
// /dev/serial/by-id/usb-FTDI_USB-RS422_Cable_FT7UFGP8-if00-port0 -> ../../ttyUSB0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does this mean?
int ret = 0; | ||
|
||
// Configure UART. | ||
_fd = ::open(_port, O_RDWR | O_NOCTTY | O_NONBLOCK); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason you're not using the Serial
abstraction? I would use it, see px4_platform_common/Serial.hpp, or the gps.cpp as an example
return; | ||
} | ||
} | ||
else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this indentation is hard to follow, all of these nested if/else statements
// read data | ||
if (fds[0].revents & POLLIN) { | ||
// POLLIN | ||
} else { | ||
// no pollin | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the point?
// printf("\n"); | ||
|
||
// Require at least 2 characters after * for checksum. | ||
// if (ret_strstr_start && (strlen(ret_strstr_start) >= 100) && ret_strstr_end && (strlen(ret_strstr_end) >= 3)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// if (ret_strstr_start && (strlen(ret_strstr_start) >= 100) && ret_strstr_end && (strlen(ret_strstr_end) >= 3)) |
This is a driver that supports interfacing to an external Anello X3 Inertial Measurement Unit (IMU) sensor.
User's implementing autonomous navigation solutions who would like to leverage the Anello X3 IMU will now have the driver code necessary to interface with the device.