tmcg0 / bioslam Goto Github PK
View Code? Open in Web Editor NEWIMU-based human skeletal pose estimation in C++11
License: MIT License
IMU-based human skeletal pose estimation in C++11
License: MIT License
See testNoiseModels.cpp
For some reason, all of my noise models calls (i.e., gtsam::noiseModel::Diagonal::Sigmas
) are all returning shared pointers to gtsam isotropic noise models or constrained noise models (i.e., the wrong type--we want diagonal noise models). It seems to be working okay in lowerbodypoesestimator though. Figure this problem out.
Platform Windows 11Pro
Docker version 20.10.17, build 100c701
Execution command: cd docker ; docker build .
Error log:
#37 5.598 /usr/local/include/highfive/bits/H5Converter_misc.hpp:83:19: error: static assertion failed: Booleans are not supported yet.
#37 5.598 83 | static_assert(!std::is_same<type, bool>::value, "Booleans are not supported yet.");
#37 5.598 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#37 8.713 /usr/src/bioslam/src/mathutils.cpp: In function 'Eigen::VectorXd mathutils::angleUnwrapOnKnownDomain(const VectorXd&, const double&, const double&, const double&)':
#37 8.713 /usr/src/bioslam/src/mathutils.cpp:410:49: warning: unused variable 'domainCenter' [-Wunused-variable]
#37 8.713 410 | double domainWidth=domainMax-domainMin, domainCenter=(domainMax+domainMin)/2;
#37 8.713 | ^~~~~~~~~~~~
#37 8.792 /usr/src/bioslam/src/mathutils.cpp: In function 'Eigen::VectorXd mathutils::adjustRegressionSlopeToTargetSlope(const VectorXd&, const VectorXd&, const double&)':
#37 8.792 /usr/src/bioslam/src/mathutils.cpp:452:40: warning: unused variable 'tol' [-Wunused-variable]
#37 8.792 452 | double newSlope, newIntercept, tol=1.0e-10;
#37 8.792 | ^~~
#37 9.074 In file included from /usr/local/include/highfive/bits/H5Attribute_misc.hpp:22,
#37 9.074 from /usr/local/include/highfive/bits/H5Annotate_traits_misc.hpp:18,
#37 9.074 from /usr/local/include/highfive/H5File.hpp:94,
#37 9.074 from /usr/local/include/highfive/H5Easy.hpp:58,
#37 9.074 from /usr/src/bioslam/src/lowerBodyPoseEstimator.cpp:25:
#37 9.074 /usr/local/include/highfive/bits/H5ReadWrite_misc.hpp: At global scope:
#37 9.074 /usr/local/include/highfive/bits/H5ReadWrite_misc.hpp:106:1: error: 'HighFive::details::BufferInfo<T>::BufferInfo(const HighFive::DataType&, F) [with F = HighFive::SliceTraits<Derivate>::write(const T&) [with T = bool; Derivate = HighFive::DataSet]::<lambda()>; T = bool]', declared using local type 'HighFive::SliceTraits<Derivate>::write(const T&) [with T = bool; Derivate = HighFive::DataSet]::<lambda()>', is used but never defined [-fpermissive]
#37 9.074 106 | BufferInfo<T>::BufferInfo(const DataType& dtype, F getName)
#37 9.074 | ^~~~~~~~~~~~~
#37 9.490 make[2]: *** [CMakeFiles/bioslam.dir/build.make:63: CMakeFiles/bioslam.dir/src/lowerBodyPoseEstimator.cpp.o] Error 1
#37 9.490 make[2]: *** Waiting for unfinished jobs....
#37 10.32 /usr/src/bioslam/src/gtsamutils.cpp: In function 'uint gtsamutils::nearestIdxToVal(std::vector<double>, double)':
#37 10.32 /usr/src/bioslam/src/gtsamutils.cpp:189:16: warning: 'nearestIdx' may be used uninitialized in this function [-Wmaybe-uninitialized]
#37 10.32 189 | return nearestIdx;
#37 10.32 | ^~~~~~~~~~
#37 15.54 make[1]: *** [CMakeFiles/Makefile2:173: CMakeFiles/bioslam.dir/all] Error 2
#37 15.54 make: *** [Makefile:141: all] Error 2
#37 ERROR: executor failed running [/bin/sh -c make install -j4]: exit code: 2
------
> [33/33] RUN make install -j4:
------
executor failed running [/bin/sh -c make install -j4]: exit code: 2
By default, CMake option BIOSLAM_BUILD_MATLAB_WRAPPER is set to ON. In the CMake built script, we should check to make sure the user has MATLAB installed properly on their system and set BIOSLAM_BUILD_MATLAB_WRAPPER=OFF if not.
imuDataUtils is an unnecessary dependency. Simplify it.
Full Changelog: https://github.com/tmcg0/bioslam/commits/v1.0.1
Recently, bioslam was upgraded to be compatible with exactly GTSAM 4.0.3 (as opposed to my previous hacked-up version of GTSAM). This upgrade broke the MATLAB wrapper. Issues affecting fixing the MATLAB wrapper should be documented here.
Update MATLAB code to handle preintegrated (combined) IMU measurements and parameters.
this shouldn't be too hard. In GTSAM 4.0.3, it looks like the wrapper code has been updated to expose these interfaces, which is why I previously was hacking up a version of GTSAM to do exactly that. Go through and find MATLAB examples in the GTSAM repo to update your code.
write documentation to show users how to edit GTSAM according to my PR which gave a little more functionality that we need in the bioslam MATLAB implementation.
Currently we require GTSAM 4.0.3 because that's when numericalDerivative6 was added. In order to support all the way back to GTSAM 4.0, I think it's best to just implement our own numericalDerivative.h file with numericalDerivative1-8. If ever in the future GTSAM gets to supporting 8-factor numerical derivatives, we can deprecate that new file.
In C++, I use a scheme of:
double tic=clock()
double timeElapsedSec=(clock()-tic)/CLOCKS_PER_SEC
to time things in seconds.
However, the timing seems to be accurate in debug mode, but it seems to be inaccurate in release mode. Possible that the -O3 optimization flag does something funky with moving these variables around.
Consider switching to a different timing method in the standard library (if one exists?) or switch to using the boost timers (think it's in the chrono library).
I would like to inquire which file I can run to obtain the GIF animation described in the README. Additionally, does the code provided include the part for visualizing human skeletal movement from IMU calculations? Thank you.
Your code is excellent.I would like to further develop your code to display the entire human skeleton. Thank you.
Similar to lowerBodyPoseEstimator, it is desired to save results to an .h5 file instead of individual .csv files. This would make the data much more organized and compact.
As an example, see lowerBodyPoseEstimator::saveResultsToH5File()
Hi,
I am trying your examples in matlab. I am not sure but it seems like your from
_% construct a data file
imus=OpalIMUData(fullfile(testDataDir,'20170412-162455-Y2_TUG_5.h5'));
The function OpalIMUData is missing. Thanks in advance
When I first started developing bioslam, gtsam only had a magnetometer factor which hooked into a Rot3
object, not a Pose3
object (which are the objects we use to store the pose of IMUs in bioslam). So I developed a custom factor (MagPose3Factor
) to add a magnetometer factor to a Pose3
object. Recently, a pull request was merged on gtsam that added a factor which does exactly what I wanted in the first place. It adds the factor MagPoseFactor
which is probably way more robust and better-tested than the one I had made. We should switch bioslam to use this.
Swap out bioslam's custom MagPose3Factor
with the new gtsam built-in MagPoseFactor
.
gtsam_unstable
components.This is a placeholder issue to remind us to allow bioslam to run on windows.
What needs to be done? As we find out more, we can document here.
See test of the jacobians numerically in testHipIntExtRotAngFactor.cpp.
The derivatives pass most of the time. But sometimes they fail, with error about 1e-3. I can't tell if that's too high in that our derivatives are incorrect. Sometimes the numerical derivatives also blow up and return unlikely values.
This issue is likely either due to either
For every platform that bioslam supports, a continuous integration (CI) pipeline should be setup via GitHub actions to automate unit testing. This issue can track conversation and observations related to CI setup.
To start, I'd like to test bioslam on clean setups of Ubuntu 16, 18, and 20.
upgrade dependency to GTSAM 4.2 and Boost 1.74
This was the prior note on upgrading to GTSAM 4.1.1, expecting at least this to need to be done:
Notes on upgrading for GTSAM 4.1.1
Major thing that changed which will impact bioslam should be the gtsam::Point3 interface. Point3 is just typedef'd to a vector3 now. So there's no more Point3::vector() or dot or cross. These are just namespaced functions to gtsam.
The h5 file format needs of bioslam are really slim: basic reading and writing of common types to and from files. As a result, requiring HighFive as a dependency is a little overkill. I would like to remove this dependency by creating a lightweight .h5 wrapper for bioslam purposes.
Recommendation: create a namespace called h5utils
which contains the few simple functions we need. h5utils
should include the raw h5df cpp utilities (i.e., those included when apt install libhdf5-serial-dev
is run, which is already a stated dependency of bioslam via HighFive). This would allow us to cut out the middle man, so to say.
currently requires manual LD_LIBRARY_PATH exporting -- is there a way to do this automatically, permanently in the Dockerfile?
Previously I was using Boost 1.56 on Ubuntu 18. But in 20, the default Boost version is like 1.71. In the newer version, they changed the way CMake works with Boost. Update bioslam in order to adjust for this new approach.
This issue was fixed in GTSAM here, do exactly what this was: borglab/gtsam#145
In testutils.h we reinvent the wheel with methods that return (possibly-biased) random quantities, like doubles, but also GTSAM objects like Pose3, Rot3, etc. GTSAM probably has methods which already do this and we should use those.
Much like the philosophy of GTSAM, bioslam would be made better by upgrading to at least C++ 17 (likely 20 for future proofing).
This issue tracks boost changes that need to be made, with reference counts in the bioslam codebase as of Dec 3, 2023.
958 references to boost::
in the codebase:
boost::filesystem*
-> directly switchable to std::filesystem
(C++ 17)boost::shared_ptr
-> std::shared_ptr
since C++11boost::dynamic_pointer_cast
-> std::dynamic_pointer_cast
for const lvalue reference since C++11boost::static_pointer_cast
-> std::static_pointer_cast
for const lvalue reference since C++11boost::is_base_of
-> std::is_base_of
since C++11boost::optional
-> std::optional
since C++17boost::none
-> std::nullopt
since C++17Note: direct swap replacements will not work because GTSAM often returns boost types, not std types. And these types are not implicitly converted at compile time. Before bioslam can move away from Boost, GTSAM must move away from Boost.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.