# Overview Each of the following codes allows a specific directive to be sent to a 2D planar robot: **[jointControl](#jointControl)**: Drives the robot using joint values. **[cartControl](#cartControl)**: Drives the robot using cartesian values. **[testKinematics](#testKinematics)**: Tests each kinematic algorithm and makes sure they are at the expected value. **[linearControl](#linearControl)**: Drives the robot using cartesian values in a linear trajectory. **[drawImage](#drawImage)**: Draws an input image. **[linearControlFurther](#linearControlFurther)**: Improvement of the linear control which checks for the determinant of the Jacobian to be valid. # Repository Structure ## Find below the list of executables. ### jointControl/ * @file jointControl * @author Guillaume Gibert * @version - * @date 2025/04/13 * @brief Description : This file was provided by G. Gibert. It allows to test different kinds of kinematics. * @functions : - void initRobot(DynamixelHandler& dxlHandler, std::string portName, float protocol, int baudRate) - void closeRobot(DynamixelHandler& dxlHandler) - int main() * Input: * - L1 : Length of the first link (cm) * - L2 : Length of the second link (cm) * - q1 : Input for first joint value (deg) * - q2 : Input for second joint value (deg) * - qpen : Input for the pen's joint value (deg) (-90 for drawing mode) * * Output: * - Displacement of the robot using cartesian coordinates. ## Ex. : ```./jointControl 5 6 0 0 -90``` ### cartControl/ * @file cartControl * @author Guillaume Gibert, Charles STELANDRE * @version V1 * @date 2025/04/13 * @brief Description : This file is a variant from jointControl, adapting cartesian Coordinates translation. * @functions : * @ - void initRobot(DynamixelHandler& dxlHandler, std::string portName, float protocol, int baudRate) - void closeRobot(DynamixelHandler& dxlHandler) - int main(int argc, char** argv) * Input: * - L1 : Length of the first link (cm) * - L2 : Length of the second link (cm) * - x : x-component of target position (cm) * - y : y-component of target position (cm) * * Output: * - Displacement of the robot using cartesian coordinates. ## Ex. : ```./cartControl 5 6 8 3``` ### testKinematics/ * @file testKinematics * @author Guillaume Gibert, Charles Stelandre * @version - * @date 2025/04/13 * @brief Description : This file was provided by G. Gibert. It allows to test different kinds of kinematics. * @functions : - bool testFK(float q1, float q2, float L1, float L2, std::vector expectedEndEffectorPosition, float errorThreshold) - bool testIK(float x, float y, float L1, float L2, std::vector expectedJointValues, float errorThreshold) - int main() ## Ex. : ```./testKinematics``` ### linearControl/ * @file linearControl * @author Guillaume Gibert * @version - * @date 2025/04/13 * @brief Description : This file was provided by G. Gibert. It allows to use a proportionally controlled system to join two points in a linear trajectory. * @functions : * @ - void initRobot(DynamixelHandler& dxlHandler, std::string portName, float protocol, int baudRate) - void closeRobot(DynamixelHandler& dxlHandler) - int main(int argc, char** argv) * Input: * - L1 : Length of the first link (cm) * - L2 : Length of the second link (cm) * - x : x-component of target position (cm) * - y : y-component of target position (cm) * * Output: * - Displacement of the robot using cartesian coordinates. ## Ex. : ```./linearControl 5 6 8 3``` ### drawImage/ * @file drawImage * @author Guillaume Gibert * @version - * @date 2025/04/13 * @brief Description : This file was provided by G. Gibert. It allows to use image processing to draw an image after converting it to correct dimensions. * @functions : * @ - void initRobot(DynamixelHandler& dxlHandler, std::string portName, float protocol, int baudRate) - void closeRobot(DynamixelHandler& dxlHandler) - int main(int argc, char** argv) * Input: * - L1 : Length of the first link (cm) * - L2 : Length of the second link (cm) * - image : directory of an image to use for image drawing ## Ex. : ```./drawImage 5 6 ../resource/twitter2.png ``` ### linearControlFurther/ * @file linearControl * @author Guillaume Gibert, Charles Stelandre * @version - * @date 2025/04/13 * @brief Description : This file was provided by G. Gibert, and completed by C. Stelandre. It allows to use a proportionally controlled system to join two points in a linear trajectory, while checking for the validity of a target point. * @functions : - void initRobot(DynamixelHandler& dxlHandler, std::string portName, float protocol, int baudRate) - void closeRobot(DynamixelHandler& dxlHandler) - int main(int argc, char** argv) * Input: * - L1 : Length of the first link (cm) * - L2 : Length of the second link (cm) * - x : x-component of target position (cm) * - y : y-component of target position (cm) ## Ex. : ```./linearControlFurther 5 6 8 3 ``` # README.md Documentation for the repository. # Requirements Hardware: Poppy Ergo Jr. Software: C++ Programming Libraries: Ensure required libraries (Dynamixel SDK - DynamixelHandler.h) # Installation Clone this repository: git clone https://gitarero.ecam.fr/charles.stelandre/IntroRoboticsLab1.git Open a text editor and navigate to the folder containing the .cpp file you want to use. Install any necessary library. Upload the code to your robot using a USB connection. # Usage Navigate to your installation directory. Make the file using ``` make ``` Note : Do not forget to create a lib and bin folder ! Navigate to the bin folder. Execute the desired file in the command line/ Follow any instructions provided in the comments within the code to execute experiments.