Skip to content

Conversation

mani-anello
Copy link

@mani-anello mani-anello commented Oct 9, 2025

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.

@dakejahl
Copy link
Contributor

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.

@dakejahl dakejahl marked this pull request as draft October 10, 2025 05:25
@mani-anello
Copy link
Author

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,
Mani

@dagar dagar self-requested a review October 10, 2025 18:45
Copy link
Contributor

@dakejahl dakejahl left a 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* 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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return 0;
return PX4_OK;

return PX4_OK;
}


Copy link
Contributor

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";
Copy link
Contributor

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
Copy link
Contributor

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);
Copy link
Contributor

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
Copy link
Contributor

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

Comment on lines +514 to +519
// read data
if (fds[0].revents & POLLIN) {
// POLLIN
} else {
// no pollin
}
Copy link
Contributor

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))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// if (ret_strstr_start && (strlen(ret_strstr_start) >= 100) && ret_strstr_end && (strlen(ret_strstr_end) >= 3))

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

Successfully merging this pull request may close these issues.

2 participants