diff --git a/LICENSE b/LICENSE index fa44a3c..80606bb 100644 --- a/LICENSE +++ b/LICENSE @@ -1,3 +1,5 @@ +MIT License + Copyright (c) 2018 Henrik Söderlund Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/README.md b/README.md index ec27314..b1a6c7a 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@ FABRIK based 2D Inverse kinematics solver ===== *************************************************************** -* FABRIK 2D inverse kinematics solver - Version 1.0.1 +* FABRIK 2D inverse kinematics solver - Version 1.0.3 * By Henrik Söderlund -* This Library is licensed under a GPLv3 License +* This Library is licensed under a MIT License *************************************************************** A FABRIK based inverse kinematics solver for Arduino. @@ -52,10 +52,12 @@ void loop() { // Write to the servos with limits, these will probably not be the same // for your manipulator and will have to be changed depending on your - // setup. + // setup. Since the library may output negative angles, it is important + // to apply limits before sending the angles to the servos! shoulder.write(min(180, max(0, shoulderAngle + 180/2))); elbow.write(min(180, max(0, elbowAngle + 180/2))); + // The following delay is just a part of this example delay(1000); // Solve IK, move down to x=150, y=10 @@ -71,6 +73,7 @@ void loop() { shoulder.write(min(180, max(0, shoulderAngle + 180/2))); elbow.write(min(180, max(0, elbowAngle + 180/2))); + // The following delay is just a part of this example delay(1000); } ``` @@ -94,6 +97,18 @@ Five usage examples are included which give more in-depth information: :------------------------------------------------------------------------------------------------------------------------------------------------------------:|:-------------------------------------------------------------------------------------------------------------------------------: ![Example3DOFGrippingOffset](https://github.com/henriksod/Fabrik2DArduino/blob/master/examples/example_3DOFGrippingOffset/preview.gif) | ![Example4DOF](https://github.com/henriksod/Fabrik2DArduino/blob/master/examples/example_4DOF/preview.gif) +Robot Arm Configuration +------------ +Due to many requests by email, I have decided to provide you with figures illustrating the configuration of the robot arm that is necessary for this library to work as it is supposed to. Remember that these are only examples of how your arm could look like, but the same concept is applied to any arm that you use with this library. + +Robot arm configuration in 2D: +![3DOFSetup](https://github.com/henriksod/Fabrik2DArduino/blob/master/setup/3DOFSetup.png) + +Robot arm configuration in 3D: +![4DOFSetup](https://github.com/henriksod/Fabrik2DArduino/blob/master/setup/4DOFSetup.png) + +What is important, and can be seen in the figures, is that the servos' angles have to be zero when the link is parallel to the previous link. By setting up the servos in this manner, the arm will be pointing straight up when all joint angles are set to zero. + Installation ------------ Clone this repository to your local machine, and place it in your Arduino libraries folder as 'Fabrik2DArduino'. @@ -120,4 +135,4 @@ Methods of Fabrik2D class Notice ------------ -It is recommended that you implement your own acceleration and velocity functions to make sure that your manipulator does not snap into the solved positions (which could cause breakage or slipping)! One way of doing this is to just increment the x and y positions and solving inverse kinematics over time until the manipulator has reached it's destination. +It is recommended that you implement your own acceleration and velocity functions to make sure that your manipulator does not snap into the solved positions (which could cause breakage or slipping)! One way of doing this is to interpolate the joint angles over time until the manipulator has reached it's destination. I would reccoment using [RAMP](https://github.com/siteswapjuggler/RAMP), an Arduino interpolation library made by [siteswapjuggler](https://github.com/siteswapjuggler). diff --git a/library.properties b/library.properties index bdf9ee1..b5d73c7 100644 --- a/library.properties +++ b/library.properties @@ -1,7 +1,7 @@ name=Fabrik2D -version=1.0.2 -author=Henrik Söderlund -maintainer=Henrik Söderlund +version=1.0.3 +author=Henrik Söderlund +maintainer=Henrik Söderlund sentence=A library for solving inverse kinematics in 2 dimensions using the FABRIK algorithm. paragraph=FABRIK is an iterative inverse kinematics solver algorithm by Andreas Aristidou, Joan Lasenby. It is optimal for computationally inefficient systems. category=Data Processing diff --git a/setup/3DOFSetup.png b/setup/3DOFSetup.png new file mode 100644 index 0000000..f8959be Binary files /dev/null and b/setup/3DOFSetup.png differ diff --git a/setup/4DOFSetup.png b/setup/4DOFSetup.png new file mode 100644 index 0000000..cfcdf02 Binary files /dev/null and b/setup/4DOFSetup.png differ diff --git a/src/FABRIK2D.cpp b/src/FABRIK2D.cpp index ecde32a..4f3a505 100644 --- a/src/FABRIK2D.cpp +++ b/src/FABRIK2D.cpp @@ -1,5 +1,5 @@ /********************************************************************************************** - * FABRIK 2D inverse kinematics solver - Version 1.0.0 + * FABRIK 2D inverse kinematics solver - Version 1.0.3 * by Henrik Söderlund * * Copyright (c) 2018 Henrik Söderlund diff --git a/src/FABRIK2D.h b/src/FABRIK2D.h index cfa5b05..8070cf7 100644 --- a/src/FABRIK2D.h +++ b/src/FABRIK2D.h @@ -1,5 +1,5 @@ /********************************************************************************************** - * FABRIK 2D inverse kinematics solver - Version 1.0.1 + * FABRIK 2D inverse kinematics solver - Version 1.0.3 * by Henrik Söderlund * * Copyright (c) 2018 Henrik Söderlund