NxRLab / ModernRobotics

Modern Robotics: Mechanics, Planning, and Control Code 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/
MIT License
1.9k stars 807 forks source link

C++ library port? #10

Closed Le0nX closed 5 years ago

Le0nX commented 5 years ago

Good morning! I'm one of your students of Modern Robotics MOOC on Coursra and writing you with a question from Russia!

As I can see there are only Mathematica, Matlab and Python packages for this course. I can write a C++ one and make a pull request to your github repo. How do you look at it?

jarvisschultz commented 5 years ago

This is a great offer, and a C++ implementation of this library would be a very useful contribution. That said, we don't necessarily want to commit to maintaining code that we didn't write and that is outside the original scope of this software library. @Le0nX and I discussed this via email, and the outcome is that he is going to independently develop the C++ library and push it to his own repo, and once it is ready we will feature it in documentation on the book's homepage and in this repository.

Looking forward to seeing the implementation!

stevenjj commented 5 years ago

Thanks for doing this @Le0nX . My labmate actually started writing parts of it in C++ as part of our research project together. But we only wrote the functions we needed to help compute the spatial Jacobian and forward kinematics. But, I believe it may still be of use to you.

This is the header file https://github.com/stevenjj/dreamer/blob/master/Sandboxes/gaze_control/src/gaze_control_cpp/modernRobotics.h

and this is the c++ implementation file: https://github.com/stevenjj/dreamer/blob/master/Sandboxes/gaze_control/src/gaze_control_cpp/modernRobotics.cpp

Le0nX commented 5 years ago

Hi, @stevenjj ! Thanks for your reply! Your labmate's code samples will be very helpful. Are you going to use the entire library in the future? Do you have any special wishes on build system or structure? At this moment we are going to use Cmake and Eigen.

stevenjj commented 5 years ago

Yeah, I'd love to use the entire library in the future so a complete C++ version of the current python functions would be excellent! ^_^ I think Cmake and Eigen is perfect as they are light-weight and standardized.

I believe my only request would be to include some proper install commands on CMake so that, for example, we can use find_package(modern_robotics_cpp), or it places the header files and library .so files in /usr/local, and to have some intuitive CMake variables such as ${MODERN_ROBOTICS_CPP_INCLUDE_DIR}$ and${MODERN_ROBOTICS_CPP_LIBRARIES} to easily include the header files and link the libraries in other Cmake projects.

jarvisschultz commented 5 years ago

Eigen and CMake seem like great choices to me. I also agree with @stevenjj request that some effort into writing a FindModernRobotics.cmake file would greatly increase usability for people developing on top of the lib.