From 8da275a2f5e284c53892a94c72108739dfe39995 Mon Sep 17 00:00:00 2001 From: arrenglover Date: Mon, 7 Feb 2022 13:32:14 +0000 Subject: [PATCH 1/3] moved cpp and Dockerfile to event-driven --- src/applications/IMUCalibDumper/Dockerfile | 1595 +++++++++++++++ .../IMUCalibDumper/EDPR_imu_calib.cpp | 1791 +++++++++++++++++ 2 files changed, 3386 insertions(+) create mode 100644 src/applications/IMUCalibDumper/Dockerfile create mode 100644 src/applications/IMUCalibDumper/EDPR_imu_calib.cpp diff --git a/src/applications/IMUCalibDumper/Dockerfile b/src/applications/IMUCalibDumper/Dockerfile new file mode 100644 index 000000000..6524228aa --- /dev/null +++ b/src/applications/IMUCalibDumper/Dockerfile @@ -0,0 +1,1595 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + imu_tk2/Dockerfile at docker_tests · event-driven-robotics/imu_tk2 · GitHub + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Skip to content + + + + + + + + + + +
+ +
+ + + + + + + +
+ + + +
+ + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + +
+
+ + + + + + + + +
+ + + + + Permalink + + +
+ +
+
+ + + docker_tests + + + + +
+
+
+ Switch branches/tags + +
+ + + +
+ +
+ +
+ + +
+ +
+ + + + + + + + + + + + + + + + +
+ + +
+
+
+
+ +
+ +
+ + + + Go to file + + +
+ + + + +
+
+
+ + + + + + + + +
+ +
+
+
 
+
+ +
+
 
+ Cannot retrieve contributors at this time +
+
+ + + + + + + +
+ +
+ + +
+ + 28 lines (22 sloc) + + 1.07 KB +
+ + + +
+ +
+
+ + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FROM ubuntu:20.04
LABEL maintainer="arren.glover@iit.it"
LABEL version="0.1"
LABEL description="Docker to install IMU calibration software"
+
# required libs
RUN apt update
RUN DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends build-essential cmake libeigen3-dev freeglut3-dev gnuplot vim
RUN apt install -y git libboost-dev software-properties-common libqt5core5a
RUN apt install -y libgoogle-glog-dev libgflags-dev libatlas-base-dev libsuitesparse-dev
RUN add-apt-repository ppa:rock-core/qt4 && apt update && apt install -y libqt4-dev libqt4-opengl-dev
RUN cd /usr/include && ln -sf eigen3/Eigen Eigen && ln -sf eigen3/unsupported unsupported
+
# ceres-solver
RUN cd /usr/local/src && \
git clone --depth 1 --branch 2.0.0 https://ceres-solver.googlesource.com/ceres-solver && \
mkdir ceres-solver/build && cd ceres-solver/build && \
cmake .. && make install -j12
+
# imu_tk
RUN cd /usr/local/src && \
git clone https://bitbucket.org/alberto_pretto/imu_tk.git && \
mkdir imu_tk/build && cd imu_tk/build && \
cmake .. && make -j12
+
WORKDIR /usr/local/src
+
+
+
+ + + +
+ +
+ + + + +
+ + +
+ + +
+
+ + +
+ + + +
+
+ +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + diff --git a/src/applications/IMUCalibDumper/EDPR_imu_calib.cpp b/src/applications/IMUCalibDumper/EDPR_imu_calib.cpp new file mode 100644 index 000000000..f20732051 --- /dev/null +++ b/src/applications/IMUCalibDumper/EDPR_imu_calib.cpp @@ -0,0 +1,1791 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + imu_tk2/EDPR_imu_calib.cpp at docker_tests · event-driven-robotics/imu_tk2 · GitHub + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Skip to content + + + + + + + + + + +
+ +
+ + + + + + + +
+ + + +
+ + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + +
+
+ + + + + + + + +
+ + + + + Permalink + + +
+ +
+
+ + + docker_tests + + + + +
+
+
+ Switch branches/tags + +
+ + + +
+ +
+ +
+ + +
+ +
+ + + + + + + + + + + + + + + + +
+ + +
+
+
+
+ +
+ +
+ + + + Go to file + + +
+ + + + +
+
+
+ + + + + + + + +
+ +
+
+
 
+
+ +
+
 
+ Cannot retrieve contributors at this time +
+
+ + + + + + + +
+ +
+ + +
+ + 77 lines (66 sloc) + + 3.24 KB +
+ + + +
+ +
+
+ + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#include <iostream>
#include <fstream>
#include <iomanip>
+
#include "imu_tk/io_utils.h"
#include "imu_tk/calibration.h"
#include "imu_tk/filters.h"
#include "imu_tk/integration.h"
#include "imu_tk/visualization.h"
+
using namespace std;
using namespace imu_tk;
using namespace Eigen;
+
int main(int argc, char** argv)
{
if( argc < 4 ) {
std::cout << "Calibrate IMU in the EDPR environment" << std::endl;
std::cout << "Usage: EDPR_imu_calib <acc file> <gyro file> <output file>" << std::endl;
return -1;
}
+
vector< TriadData > acc_data, gyro_data;
cout<<"Importing IMU data from the Matlab matrix file : "<< argv[1]<<endl;
importAsciiData( argv[1], acc_data, imu_tk::TIMESTAMP_UNIT_SEC );
cout<<"Importing IMU data from the Matlab matrix file : "<< argv[2]<<endl;
importAsciiData( argv[2], gyro_data, imu_tk::TIMESTAMP_UNIT_SEC );
ofstream cw(argv[3], ios_base::out|ios_base::trunc);
if(!cw.is_open()) {
std::cout << "Error: could not open output .ini file for writing" << std::endl;
return -1;
}
cout<<"Saving Calibration to the file : "<< argv[3] << endl;
CalibratedTriad init_acc_calib, init_gyro_calib;
init_acc_calib.setBias( Vector3d(0.0, 0.0, 0.0) );
init_acc_calib.setScale( Vector3d(0.00059855, 0.00059855, 0.00059855) );
init_gyro_calib.setBias( Vector3d(0.0, 0.0, 0.0) );
init_gyro_calib.setScale( Vector3d(0.000010653,0.000010653,0.000010653) );
MultiPosCalibration mp_calib;
//mp_calib.setInitStaticIntervalDuration(50.0);
mp_calib.setInitAccCalibration( init_acc_calib );
mp_calib.setInitGyroCalibration( init_gyro_calib );
mp_calib.setGravityMagnitude(9.80665);
mp_calib.enableVerboseOutput(true);
mp_calib.enableAccUseMeans(false);
//mp_calib.setGyroDataPeriod(0.01);
mp_calib.calibrateAccGyro(acc_data, gyro_data );
//mp_calib.getAccCalib().save("test_imu_acc.calib");
//mp_calib.getGyroCalib().save("test_imu_gyro.calib");
+
cw << std::fixed << std::setprecision(8);
const Vector3d &abv = mp_calib.getAccCalib().getBiasVector();
cw << "ACC_BIAS (" << abv[0] << " " << abv[1] << " " << abv[2] << ")" << std::endl;
const Matrix3d &abg = mp_calib.getAccCalib().getScaleMatrix();
cw << "ACC_GAIN (" << abg(0, 0) << " " << abg(1, 1) << " " << abg(2, 2) << ")" << std::endl;
const Matrix3d &abs = mp_calib.getAccCalib().getMisalignmentMatrix();
cw << "ACC_SKEW (" << abs(0, 0) << " " << abs(0, 1) << " " << abs(0, 2) << " "
<< abs(1, 0) << " " << abs(1, 1) << " " << abs(1, 2) << " "
<< abs(2, 0) << " " << abs(2, 1) << " " << abs(2, 2) << ")"
<< std::endl;
const Vector3d &gbv = mp_calib.getGyroCalib().getBiasVector();
cw << "GYR_BIAS (" << gbv[0] << " " << gbv[1] << " " << gbv[2] << ")" << std::endl;
const Matrix3d &gbg = mp_calib.getGyroCalib().getScaleMatrix();
cw << "GYR_GAIN (" << gbg(0, 0) << " " << gbg(1, 1) << " " << gbg(2, 2) << ")" << std::endl;
const Matrix3d &gbs = mp_calib.getGyroCalib().getMisalignmentMatrix();
cw << "GYR_SKEW (" << gbs(0, 0) << " " << gbs(0, 1) << " " << gbs(0, 2) << " "
<< gbs(1, 0) << " " << gbs(1, 1) << " " << gbs(1, 2) << " "
<< gbs(2, 0) << " " << gbs(2, 1) << " " << gbs(2, 2) << ")"
<< std::endl;
+
return 0;
}
+
+ + + +
+ +
+ + + + +
+ + +
+ + +
+
+ + +
+ + + +
+
+ +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + From 25e2e469ebe7cc2ae992ac865ec67d6385fda832 Mon Sep 17 00:00:00 2001 From: arrenglover Date: Mon, 7 Feb 2022 15:17:10 +0000 Subject: [PATCH 2/3] EDPR_imu_calib CMake builds upon imu_tk --- .../IMUCalibDumper/CMakeLists.txt | 8 - src/applications/IMUCalibDumper/Dockerfile | 1595 --------------- .../IMUCalibDumper/EDPR_imu_calib.cpp | 1791 ----------------- .../imuCalibration/CMakeLists.txt | 61 + src/applications/imuCalibration/Dockerfile | 36 + .../imuCalibration/EDPR_imu_calib.cpp | 77 + .../app_IMUCalibDumper.xml | 0 7 files changed, 174 insertions(+), 3394 deletions(-) delete mode 100644 src/applications/IMUCalibDumper/CMakeLists.txt delete mode 100644 src/applications/IMUCalibDumper/Dockerfile delete mode 100644 src/applications/IMUCalibDumper/EDPR_imu_calib.cpp create mode 100644 src/applications/imuCalibration/CMakeLists.txt create mode 100644 src/applications/imuCalibration/Dockerfile create mode 100644 src/applications/imuCalibration/EDPR_imu_calib.cpp rename src/applications/{IMUCalibDumper => imuCalibration}/app_IMUCalibDumper.xml (100%) diff --git a/src/applications/IMUCalibDumper/CMakeLists.txt b/src/applications/IMUCalibDumper/CMakeLists.txt deleted file mode 100644 index 7c6895b0e..000000000 --- a/src/applications/IMUCalibDumper/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -project(IMUCalibDumper) - -yarp_install(FILES app_${PROJECT_NAME}.xml - DESTINATION ${EVENT-DRIVEN_APPLICATIONS_INSTALL_DIR}) - -if(ADD_DOCS_TO_IDE) - add_custom_target(${PROJECT_NAME}_docs SOURCES app_${PROJECT_NAME}.xml) -endif(ADD_DOCS_TO_IDE) diff --git a/src/applications/IMUCalibDumper/Dockerfile b/src/applications/IMUCalibDumper/Dockerfile deleted file mode 100644 index 6524228aa..000000000 --- a/src/applications/IMUCalibDumper/Dockerfile +++ /dev/null @@ -1,1595 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - imu_tk2/Dockerfile at docker_tests · event-driven-robotics/imu_tk2 · GitHub - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Skip to content - - - - - - - - - - -
- -
- - - - - - - -
- - - -
- - - - - - - - - - -
-
-
- - - - - - - - - - - - - - - - -
-
- - - - - - - - -
- - - - - Permalink - - -
- -
-
- - - docker_tests - - - - -
-
-
- Switch branches/tags - -
- - - -
- -
- -
- - -
- -
- - - - - - - - - - - - - - - - -
- - -
-
-
-
- -
- -
- - - - Go to file - - -
- - - - -
-
-
- - - - - - - - -
- -
-
-
 
-
- -
-
 
- Cannot retrieve contributors at this time -
-
- - - - - - - -
- -
- - -
- - 28 lines (22 sloc) - - 1.07 KB -
- - - -
- -
-
- - - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FROM ubuntu:20.04
LABEL maintainer="arren.glover@iit.it"
LABEL version="0.1"
LABEL description="Docker to install IMU calibration software"
-
# required libs
RUN apt update
RUN DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends build-essential cmake libeigen3-dev freeglut3-dev gnuplot vim
RUN apt install -y git libboost-dev software-properties-common libqt5core5a
RUN apt install -y libgoogle-glog-dev libgflags-dev libatlas-base-dev libsuitesparse-dev
RUN add-apt-repository ppa:rock-core/qt4 && apt update && apt install -y libqt4-dev libqt4-opengl-dev
RUN cd /usr/include && ln -sf eigen3/Eigen Eigen && ln -sf eigen3/unsupported unsupported
-
# ceres-solver
RUN cd /usr/local/src && \
git clone --depth 1 --branch 2.0.0 https://ceres-solver.googlesource.com/ceres-solver && \
mkdir ceres-solver/build && cd ceres-solver/build && \
cmake .. && make install -j12
-
# imu_tk
RUN cd /usr/local/src && \
git clone https://bitbucket.org/alberto_pretto/imu_tk.git && \
mkdir imu_tk/build && cd imu_tk/build && \
cmake .. && make -j12
-
WORKDIR /usr/local/src
-
-
-
- - - -
- -
- - - - -
- - -
- - -
-
- - -
- - - -
-
- -
-
- -
- - - - - - - - - - - - - - - - - - - - - diff --git a/src/applications/IMUCalibDumper/EDPR_imu_calib.cpp b/src/applications/IMUCalibDumper/EDPR_imu_calib.cpp deleted file mode 100644 index f20732051..000000000 --- a/src/applications/IMUCalibDumper/EDPR_imu_calib.cpp +++ /dev/null @@ -1,1791 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - imu_tk2/EDPR_imu_calib.cpp at docker_tests · event-driven-robotics/imu_tk2 · GitHub - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Skip to content - - - - - - - - - - -
- -
- - - - - - - -
- - - -
- - - - - - - - - - -
-
-
- - - - - - - - - - - - - - - - -
-
- - - - - - - - -
- - - - - Permalink - - -
- -
-
- - - docker_tests - - - - -
-
-
- Switch branches/tags - -
- - - -
- -
- -
- - -
- -
- - - - - - - - - - - - - - - - -
- - -
-
-
-
- -
- -
- - - - Go to file - - -
- - - - -
-
-
- - - - - - - - -
- -
-
-
 
-
- -
-
 
- Cannot retrieve contributors at this time -
-
- - - - - - - -
- -
- - -
- - 77 lines (66 sloc) - - 3.24 KB -
- - - -
- -
-
- - - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#include <iostream>
#include <fstream>
#include <iomanip>
-
#include "imu_tk/io_utils.h"
#include "imu_tk/calibration.h"
#include "imu_tk/filters.h"
#include "imu_tk/integration.h"
#include "imu_tk/visualization.h"
-
using namespace std;
using namespace imu_tk;
using namespace Eigen;
-
int main(int argc, char** argv)
{
if( argc < 4 ) {
std::cout << "Calibrate IMU in the EDPR environment" << std::endl;
std::cout << "Usage: EDPR_imu_calib <acc file> <gyro file> <output file>" << std::endl;
return -1;
}
-
vector< TriadData > acc_data, gyro_data;
cout<<"Importing IMU data from the Matlab matrix file : "<< argv[1]<<endl;
importAsciiData( argv[1], acc_data, imu_tk::TIMESTAMP_UNIT_SEC );
cout<<"Importing IMU data from the Matlab matrix file : "<< argv[2]<<endl;
importAsciiData( argv[2], gyro_data, imu_tk::TIMESTAMP_UNIT_SEC );
ofstream cw(argv[3], ios_base::out|ios_base::trunc);
if(!cw.is_open()) {
std::cout << "Error: could not open output .ini file for writing" << std::endl;
return -1;
}
cout<<"Saving Calibration to the file : "<< argv[3] << endl;
CalibratedTriad init_acc_calib, init_gyro_calib;
init_acc_calib.setBias( Vector3d(0.0, 0.0, 0.0) );
init_acc_calib.setScale( Vector3d(0.00059855, 0.00059855, 0.00059855) );
init_gyro_calib.setBias( Vector3d(0.0, 0.0, 0.0) );
init_gyro_calib.setScale( Vector3d(0.000010653,0.000010653,0.000010653) );
MultiPosCalibration mp_calib;
//mp_calib.setInitStaticIntervalDuration(50.0);
mp_calib.setInitAccCalibration( init_acc_calib );
mp_calib.setInitGyroCalibration( init_gyro_calib );
mp_calib.setGravityMagnitude(9.80665);
mp_calib.enableVerboseOutput(true);
mp_calib.enableAccUseMeans(false);
//mp_calib.setGyroDataPeriod(0.01);
mp_calib.calibrateAccGyro(acc_data, gyro_data );
//mp_calib.getAccCalib().save("test_imu_acc.calib");
//mp_calib.getGyroCalib().save("test_imu_gyro.calib");
-
cw << std::fixed << std::setprecision(8);
const Vector3d &abv = mp_calib.getAccCalib().getBiasVector();
cw << "ACC_BIAS (" << abv[0] << " " << abv[1] << " " << abv[2] << ")" << std::endl;
const Matrix3d &abg = mp_calib.getAccCalib().getScaleMatrix();
cw << "ACC_GAIN (" << abg(0, 0) << " " << abg(1, 1) << " " << abg(2, 2) << ")" << std::endl;
const Matrix3d &abs = mp_calib.getAccCalib().getMisalignmentMatrix();
cw << "ACC_SKEW (" << abs(0, 0) << " " << abs(0, 1) << " " << abs(0, 2) << " "
<< abs(1, 0) << " " << abs(1, 1) << " " << abs(1, 2) << " "
<< abs(2, 0) << " " << abs(2, 1) << " " << abs(2, 2) << ")"
<< std::endl;
const Vector3d &gbv = mp_calib.getGyroCalib().getBiasVector();
cw << "GYR_BIAS (" << gbv[0] << " " << gbv[1] << " " << gbv[2] << ")" << std::endl;
const Matrix3d &gbg = mp_calib.getGyroCalib().getScaleMatrix();
cw << "GYR_GAIN (" << gbg(0, 0) << " " << gbg(1, 1) << " " << gbg(2, 2) << ")" << std::endl;
const Matrix3d &gbs = mp_calib.getGyroCalib().getMisalignmentMatrix();
cw << "GYR_SKEW (" << gbs(0, 0) << " " << gbs(0, 1) << " " << gbs(0, 2) << " "
<< gbs(1, 0) << " " << gbs(1, 1) << " " << gbs(1, 2) << " "
<< gbs(2, 0) << " " << gbs(2, 1) << " " << gbs(2, 2) << ")"
<< std::endl;
-
return 0;
}
-
- - - -
- -
- - - - -
- - -
- - -
-
- - -
- - - -
-
- -
-
- -
- - - - - - - - - - - - - - - - - - - - - diff --git a/src/applications/imuCalibration/CMakeLists.txt b/src/applications/imuCalibration/CMakeLists.txt new file mode 100644 index 000000000..94d735668 --- /dev/null +++ b/src/applications/imuCalibration/CMakeLists.txt @@ -0,0 +1,61 @@ +project(EDPR_imutk_app) + +cmake_minimum_required (VERSION 2.8) +cmake_policy(SET CMP0015 NEW) + +if ("${CMAKE_BUILD_TYPE}" STREQUAL "") + set(CMAKE_BUILD_TYPE "Release") +endif() + +find_package(Boost REQUIRED) +find_package(Eigen3 REQUIRED) +find_package(Ceres REQUIRED) + +include_directories(./include + /usr/include + ${Boost_INCLUDE_DIRS} + ${EIGEN_INCLUDE_DIR} + ${CERES_INCLUDE_DIRS}) + +#Vis3D +find_package(Qt4 COMPONENTS QtCore QtGui QtOpenGL REQUIRED ) +find_package(OpenGL REQUIRED) +find_package(GLUT REQUIRED) + +include_directories( ${OPENGL_INCLUDE_DIRS} + ${GLUT_INCLUDE_DIRS} + ${CMAKE_CURRENT_BINARY_DIR} ) + +set(IMU_TK_VIS_EXTRA_SOURCES + /usr/local/src/imu_tk/src/vis_extra/gl_camera.cpp + /usr/local/src/imu_tk/src/vis_extra/opengl_3d_scene.cpp ) +set(IMU_TK_VIS_EXTRA_HEADERS + /usr/local/src/imu_tk/include/imu_tk/vis_extra/opengl_3d_scene.h ) + +qt4_wrap_cpp(IMU_TK_VIS_EXTRA_HEADERS_MOC ${IMU_TK_VIS_EXTRA_HEADERS}) + +include(${QT_USE_FILE}) +add_definitions(${QT_DEFINITIONS}) + +aux_source_directory( /usr/local/src/imu_tk/src IMU_TK_CORE_SRC ) +set( IMU_TK_SRC ${IMU_TK_CORE_SRC} ${IMU_TK_VIS_EXTRA_HEADERS_MOC} ${IMU_TK_VIS_EXTRA_SOURCES} ) + +set (IMU_TK_INCLUDE_DIR /usr/local/src/imu_tk/include CACHE STRING "imu_tk include directories") +set (IMU_TK_LIB_DIR /usr/local/src/imu_tk/lib CACHE STRING "imu_tk libraries directories") +set (IMU_TK_LIBS imu_tk ${CERES_LIBRARIES} ${QT_LIBRARIES} ${OPENGL_LIBRARIES} ${GLUT_LIBRARY} + CACHE STRING "imu_tk libraries") + +#add_library( imu_tk UNKNOWN IMPORTED) +#set_property(TARGET imu_tk PROPERTY IMPORTED_LOCATION "/usr/local/src/imu_tk/lib/libimu_tk.a") + +add_library(imu_tk ${IMU_TK_SRC}) +set_target_properties(imu_tk PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${IMU_TK_LIB_DIR}) +target_include_directories(imu_tk PRIVATE ${IMU_TK_INCLUDE_DIR}) + +message( "${IMU_TK_LIBS}" ) + +add_executable(EDPR_imu_calib EDPR_imu_calib.cpp) +target_include_directories(EDPR_imu_calib PRIVATE ${IMU_TK_INCLUDE_DIR}) +target_link_libraries( EDPR_imu_calib ${IMU_TK_LIBS}) +#set_target_properties( EDPR_imu_calib PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin) + diff --git a/src/applications/imuCalibration/Dockerfile b/src/applications/imuCalibration/Dockerfile new file mode 100644 index 000000000..3028591e9 --- /dev/null +++ b/src/applications/imuCalibration/Dockerfile @@ -0,0 +1,36 @@ +FROM ubuntu:20.04 +LABEL maintainer="arren.glover@iit.it" +LABEL version="0.1" +LABEL description="Docker to install IMU calibration software" + +# required libs +RUN apt update +RUN DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends build-essential cmake libeigen3-dev freeglut3-dev gnuplot vim +RUN apt install -y git libboost-dev software-properties-common libqt5core5a +RUN apt install -y libgoogle-glog-dev libgflags-dev libatlas-base-dev libsuitesparse-dev +RUN add-apt-repository ppa:rock-core/qt4 && apt update && apt install -y libqt4-dev libqt4-opengl-dev +RUN cd /usr/include && ln -sf eigen3/Eigen Eigen && ln -sf eigen3/unsupported unsupported + +# ceres-solver +RUN cd /usr/local/src && \ + git clone --depth 1 --branch 2.0.0 https://ceres-solver.googlesource.com/ceres-solver && \ + mkdir ceres-solver/build && cd ceres-solver/build && \ + cmake .. && make install -j12 + +# imu_tk +RUN cd /usr/local/src && \ + git clone https://bitbucket.org/alberto_pretto/imu_tk.git + #&& \ + #mkdir imu_tk/build && cd imu_tk/build && \ + #cmake .. && make -j12 + +# edpr imu_tk application +RUN cd /usr/local/src && \ + git clone https://github.com/robotology/event-driven.git && \ + cd event-driven/src/applications/imuCalibration && \ + mkdir build && cd build && \ + cmake .. && make -j12 + +WORKDIR /usr/local/src + + diff --git a/src/applications/imuCalibration/EDPR_imu_calib.cpp b/src/applications/imuCalibration/EDPR_imu_calib.cpp new file mode 100644 index 000000000..85626fc28 --- /dev/null +++ b/src/applications/imuCalibration/EDPR_imu_calib.cpp @@ -0,0 +1,77 @@ +#include +#include +#include + +#include "imu_tk/io_utils.h" +#include "imu_tk/calibration.h" +#include "imu_tk/filters.h" +#include "imu_tk/integration.h" +#include "imu_tk/visualization.h" + +using namespace std; +using namespace imu_tk; +using namespace Eigen; + +int main(int argc, char** argv) +{ + if( argc < 4 ) { + std::cout << "Calibrate IMU in the EDPR environment" << std::endl; + std::cout << "Usage: EDPR_imu_calib " << std::endl; + return -1; + } + + vector< TriadData > acc_data, gyro_data; + + cout<<"Importing IMU data from the Matlab matrix file : "<< argv[1]< Date: Mon, 7 Feb 2022 15:22:10 +0000 Subject: [PATCH 3/3] removed install of imu calibration dumper .xml --- src/applications/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/src/applications/CMakeLists.txt b/src/applications/CMakeLists.txt index d721bf701..411d3e2af 100644 --- a/src/applications/CMakeLists.txt +++ b/src/applications/CMakeLists.txt @@ -7,7 +7,6 @@ option(ENABLE_view "Build basic viewer" ON) option(ENABLE_soundDetectionDemo "Build sound source detection demo" OFF) option(ENABLE_corner "Build corner detector" OFF) option(ENABLE_dualCamTransform "Build event to frame transform" OFF) -option(ENABLE_IMUcalibapp "Install IMU calibration dumper app" OFF) if(ENABLE_autosaccade) add_subdirectory(autosaccade)