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

Altimu 10v5 support #31

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Altimu 10v5 support #31

wants to merge 3 commits into from

Conversation

Glorf
Copy link

@Glorf Glorf commented Oct 22, 2018

Hi

For my project I needed to adapt your code to use with AltiMU10. I've also set up lps25h and made minor pacer improvements. It's tested and 100% working, thus this PR is not a clean one (changed hardcodes, and set up default device to altimu)
As I've found no easy option to add another device, feel free to use and/or adapt my code to your project if you think it's worth it

Best regards and thanks for amazing project, it saved me a lot of programming and provided my high altitude balloon with accurate measurements :)

@DavidEGrayson
Copy link
Owner

DavidEGrayson commented Oct 22, 2018

Yes, I can't accept this as-is because of how much it changes/breaks the software for existing users, but thank you anyway for making the pull request. Someone will probably find it useful. I'll keep this open as a reminder that maybe I should make it easier to add more devices and read data from them.

@kramer65
Copy link

kramer65 commented Jul 19, 2020

@Glorf - I also need to be able to determine the altitude with the altimu, so this would be awesome. I'm having trouble building it though.

I first built the upstream minimu9-ahrs by @DavidEGrayson and that works. So I've got all dependencies for building it, and running it works great.

I then cloned your fork @Glorf and tried building that, but I run into the errors I pasted below.

I'm trying building it on a raspi zero running an fully updated Raspbian Buster and I installed the following dependencies:

sudo apt install -y libi2c-dev libeigen3-dev libboost-program-options-dev
$ make
g++  -I. -I/usr/include/eigen3 -Wall -std=gnu++11 -O2 -MD -MP vector.h -o vector.h.gch
g++  -I. -I/usr/include/eigen3 -Wall -std=gnu++11 -O2 -MD -MP  -c -o minimu9-ahrs.o minimu9-ahrs.cpp
g++  -I. -I/usr/include/eigen3 -Wall -std=gnu++11 -O2 -MD -MP  -c -o lsm303.o lsm303.cpp
g++  -I. -I/usr/include/eigen3 -Wall -std=gnu++11 -O2 -MD -MP  -c -o lps25h.o lps25h.cpp
g++  -I. -I/usr/include/eigen3 -Wall -std=gnu++11 -O2 -MD -MP  -c -o minimu9.o minimu9.cpp
g++  -I. -I/usr/include/eigen3 -Wall -std=gnu++11 -O2 -MD -MP  -c -o lsm6.o lsm6.cpp
g++  -I. -I/usr/include/eigen3 -Wall -std=gnu++11 -O2 -MD -MP  -c -o prog_options.o prog_options.cpp
g++  -I. -I/usr/include/eigen3 -Wall -std=gnu++11 -O2 -MD -MP  -c -o i2c_bus.o i2c_bus.cpp
i2c_bus.cpp: In member function 'void i2c_bus::write_byte_and_read(uint8_t, uint8_t, uint8_t*, size_t)':
i2c_bus.cpp:80:38: error: invalid use of incomplete type 'struct i2c_msg'
     { address, 0, 1, (typeof(i2c_msg().buf)) &command },
                                      ^
In file included from i2c_bus.cpp:8:
/usr/include/linux/i2c-dev.h:66:9: note: forward declaration of 'struct i2c_msg'
  struct i2c_msg *msgs; /* pointers to i2c_msgs */
         ^~~~~~~
i2c_bus.cpp:81:16: error: 'I2C_M_RD' was not declared in this scope
     { address, I2C_M_RD, (typeof(i2c_msg().len)) size, (typeof(i2c_msg().buf)) data },
                ^~~~~~~~
i2c_bus.cpp:81:16: note: suggested alternative: 'I2C_RDWR'
     { address, I2C_M_RD, (typeof(i2c_msg().len)) size, (typeof(i2c_msg().buf)) data },
                ^~~~~~~~
                I2C_RDWR
i2c_bus.cpp:81:42: error: invalid use of incomplete type 'struct i2c_msg'
     { address, I2C_M_RD, (typeof(i2c_msg().len)) size, (typeof(i2c_msg().buf)) data },
                                          ^
In file included from i2c_bus.cpp:8:
/usr/include/linux/i2c-dev.h:66:9: note: forward declaration of 'struct i2c_msg'
  struct i2c_msg *msgs; /* pointers to i2c_msgs */
         ^~~~~~~
i2c_bus.cpp:81:72: error: invalid use of incomplete type 'struct i2c_msg'
     { address, I2C_M_RD, (typeof(i2c_msg().len)) size, (typeof(i2c_msg().buf)) data },
                                                                        ^
In file included from i2c_bus.cpp:8:
/usr/include/linux/i2c-dev.h:66:9: note: forward declaration of 'struct i2c_msg'
  struct i2c_msg *msgs; /* pointers to i2c_msgs */
         ^~~~~~~
i2c_bus.cpp:79:11: error: elements of array 'i2c_msg messages [2]' have incomplete type
   i2c_msg messages[2] = {
           ^~~~~~~~
i2c_bus.cpp:79:11: error: storage size of 'messages' isn't known
i2c_bus.cpp:85:16: error: 'ioctl' was not declared in this scope
   int result = ioctl(fd, I2C_RDWR, &ioctl_data);
                ^~~~~
i2c_bus.cpp: In member function 'void i2c_bus::write(uint8_t, const uint8_t*, size_t)':
i2c_bus.cpp:96:35: error: invalid use of incomplete type 'struct i2c_msg'
     { address, 0, (typeof(i2c_msg().len)) size, (typeof(i2c_msg().buf)) data }
                                   ^
In file included from i2c_bus.cpp:8:
/usr/include/linux/i2c-dev.h:66:9: note: forward declaration of 'struct i2c_msg'
  struct i2c_msg *msgs; /* pointers to i2c_msgs */
         ^~~~~~~
i2c_bus.cpp:96:65: error: invalid use of incomplete type 'struct i2c_msg'
     { address, 0, (typeof(i2c_msg().len)) size, (typeof(i2c_msg().buf)) data }
                                                                 ^
In file included from i2c_bus.cpp:8:
/usr/include/linux/i2c-dev.h:66:9: note: forward declaration of 'struct i2c_msg'
  struct i2c_msg *msgs; /* pointers to i2c_msgs */
         ^~~~~~~
i2c_bus.cpp:95:11: error: elements of array 'i2c_msg messages [1]' have incomplete type
   i2c_msg messages[1] = {
           ^~~~~~~~
i2c_bus.cpp:95:11: error: storage size of 'messages' isn't known
i2c_bus.cpp:100:16: error: 'ioctl' was not declared in this scope
   int result = ioctl(fd, I2C_RDWR, &ioctl_data);
                ^~~~~
i2c_bus.cpp: In member function 'int i2c_bus::try_write_byte_and_read(uint8_t, uint8_t, uint8_t*, size_t)':
i2c_bus.cpp:112:38: error: invalid use of incomplete type 'struct i2c_msg'
     { address, 0, 1, (typeof(i2c_msg().buf))&byte },
                                      ^
In file included from i2c_bus.cpp:8:
/usr/include/linux/i2c-dev.h:66:9: note: forward declaration of 'struct i2c_msg'
  struct i2c_msg *msgs; /* pointers to i2c_msgs */
         ^~~~~~~
i2c_bus.cpp:113:16: error: 'I2C_M_RD' was not declared in this scope
     { address, I2C_M_RD, (typeof(i2c_msg().len))size, (typeof(i2c_msg().buf))data },
                ^~~~~~~~
i2c_bus.cpp:113:16: note: suggested alternative: 'I2C_RDWR'
     { address, I2C_M_RD, (typeof(i2c_msg().len))size, (typeof(i2c_msg().buf))data },
                ^~~~~~~~
                I2C_RDWR
i2c_bus.cpp:113:42: error: invalid use of incomplete type 'struct i2c_msg'
     { address, I2C_M_RD, (typeof(i2c_msg().len))size, (typeof(i2c_msg().buf))data },
                                          ^
In file included from i2c_bus.cpp:8:
/usr/include/linux/i2c-dev.h:66:9: note: forward declaration of 'struct i2c_msg'
  struct i2c_msg *msgs; /* pointers to i2c_msgs */
         ^~~~~~~
i2c_bus.cpp:113:71: error: invalid use of incomplete type 'struct i2c_msg'
     { address, I2C_M_RD, (typeof(i2c_msg().len))size, (typeof(i2c_msg().buf))data },
                                                                       ^
In file included from i2c_bus.cpp:8:
/usr/include/linux/i2c-dev.h:66:9: note: forward declaration of 'struct i2c_msg'
  struct i2c_msg *msgs; /* pointers to i2c_msgs */
         ^~~~~~~
i2c_bus.cpp:111:11: error: elements of array 'i2c_msg messages [2]' have incomplete type
   i2c_msg messages[2] = {
           ^~~~~~~~
i2c_bus.cpp:111:11: error: storage size of 'messages' isn't known
i2c_bus.cpp:117:16: error: 'ioctl' was not declared in this scope
   int result = ioctl(fd, I2C_RDWR, &ioctl_data);
                ^~~~~
make: *** [<builtin>: i2c_bus.o] Error 1

@Glorf
Copy link
Author

Glorf commented Aug 2, 2020

Hi, @kramer65 , good to hear that my changes might be of use
Honestly, after the initial commit, I didn't keep these changes upstream with @DavidEGrayson repo, so the code might be somewhat obsolete
The exact problem you have might be related to the recent commit in the upstream repo: c42cca6
I suggest applying these changes on top of mine and trying if it works.

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.

None yet

3 participants