Git Product home page Git Product logo

le0nx / modernroboticscpp Goto Github PK

View Code? Open in Web Editor NEW
412.0 14.0 139.0 89 KB

Modern Robotics: Mechanics, Planning, and Control C++ Library --- The primary purpose of the provided software is to be easy to read and educational, reinforcing the concepts in the book. The code is optimized neither for efficiency nor robustness. http://modernrobotics.org/

CMake 3.58% C++ 96.42%
cpp robotics modern-robotics cpp11 math eigen control

modernroboticscpp's Introduction

Modern Robotics: Mechanics, Planning, and Control

C++ Library

This repository contains the code library accompanying Modern Robotics: Mechanics, Planning, and Control (Kevin Lynch and Frank Park, Cambridge University Press 2017). The user manual is in the doc directory of main repository.

The functions are available in:

Each function has a commented section above it explaining the inputs required for its use as well as an example of how it can be used and what the output will be. This repository also contains a pdf document that provides an overview of the available functions using MATLAB syntax. Functions are organized according to the chapter in which they are introduced in the book. Basic functions, such as functions to calculate the magnitude of a vector, normalize a vector, test if the value is near zero, and perform matrix operations such as multiplication and inverses, are not documented here.

The primary purpose of the provided software is to be easy to read and educational, reinforcing the concepts in the book. The code is optimized neither for efficiency nor robustness.

Installation

1. Install Eigen library.

  • On Mac
foo@bar:~$ brew install eigen
  • On Linux
foo@bar:~$ sudo apt-get install libeigen3-dev

2. Prepare build

foo@bar:~$ mkdir build && cd build

By default cmake will install our build into the system directories. To define a custom install directory we simply pass it to cmake:

foo@bar:build $ cmake .. -DCMAKE_INSTALL_PREFIX=../_install

Or just configure with defaults

foo@bar:build $ cmake ..

Building and installing library

foo@bar:build $ make all && make install

Testing the library

foo@bar:build $ ./lib_test

modernroboticscpp's People

Contributors

ipa avatar le0nx avatar shuoyangrobotics avatar swiz23 avatar wayne-xiu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

modernroboticscpp's Issues

Test file criterion wrong

In the test file, the test criterion is set to
ASSERT_TRUE(M.isApprox(result, 4));

According to Eigen Doc, this means as long as the difference is smaller than 4 times of min(M, result), it will pass. This is wrong. If you change a little bit of force or matrix list, the test still pass.

Normally we should set the criterion to something like 1e-4.

What is the current progress

Hi Le0nX,

I was using Modern Robotics Matlab package recently and thinking of writing my own C++ version but I found your implementation and saw your discussion with stevenjj. Thanks for doing this effort. I want to contribute as well. I would like to know what is your current progress? I folked this repo and will do some testing soon to make it more complete. If you are working on improving the current repo, could you share your currrent progress and development plan?

Please initialize your matrix properly

I submitted a pr to master about adding inverseDynamics.

During the implementation of this function, I experience some numerical problems, I have to stay up until 1:00am to debug. I found them come from TransInv, I need to modifiy it in the following way:

2

Eigen does not initiate matrixXd to be all zero values. You have to manual initialize them otherwise they will keep random values that can cause numerical issues.

Please initialize your matrix properly, thanks.

CMakeLists.txt issues

Just tried to compile on my Ubuntu 16.04 system, and there are a variety of issues that cause this not to compile:

  • Your cmake_minimum_required version is fairly new. Is there a reason for that? I'm guessing this project would work fine with an older CMake, and that would increase compatibility. Even Ubuntu 18.04 is only on 3.10
  • There are mixed capital letters and lowercase (e.g. set and SET). While not wrong, it is inconsistent.
  • Why do you have the users set an EIGEN3_INCLUDE_DIR, and also find_package Eigen? If you can properly run find_package shouldn't EIGEN_INCLUDE_DIRS already be set? Check out this CMakeLists.txt for a good example.
  • You specify a specific Eigen version, but I'm guessing you don't need that either. Also hurts compatibility.
  • Would probably be a good idea to compile the testing executable with CMake's add_test
  • You specify C++ 17, but you aren't using any C++17 features. C++17 requires a newer compiler, and hurts compatibility. I'd suggest specifying the minimum version you need.

Hope that helps out! Let me know if there are any questions.

Document Idea

It is not clear to find functions from header file. We should start to document our code and organize it sooner vs later.
Using doxygen would be a good way to go. We could add this to the project TODO.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.