diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 2f86bd7e..6c826bc2 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -2,9 +2,9 @@ name: CMake on: push: - branches: [main, "v*.x"] + branches: [v1.x] pull_request: - branches: [main, "v*.x"] + branches: [v1.x] workflow_dispatch: env: diff --git a/CMakeLists.txt b/CMakeLists.txt index 695b06a3..3a35e6e7 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.16.3) # =================================================================== # PROJECT SETUP # =================================================================== -project(flexiv_rdk VERSION 1.9.2 LANGUAGES CXX) +project(flexiv_rdk VERSION 1.9.3 LANGUAGES CXX) # Configure build type if(NOT CMAKE_BUILD_TYPE) diff --git a/README.md b/README.md index 17a3e8a5..2080dfb9 100644 --- a/README.md +++ b/README.md @@ -182,11 +182,4 @@ Note: ## API Documentation -The complete and detailed API documentation of the **latest release** can be found at [Flexiv RDK APIs](https://www.flexiv.com/software/rdk/api). The API documentation of a previous release can be generated manually using Doxygen. For example, on Linux: - - sudo apt install doxygen-latex graphviz - cd flexiv_rdk - git checkout - doxygen doc/Doxyfile.in - -Open any html file under `flexiv_rdk/doc/html/` with your browser to view the doc. +The complete and detailed API documentation can be found at [Flexiv RDK APIs](https://www.flexiv.com/software/rdk/api). The page shows the latest release by default. You can view previous releases using the dropdown menu at the top right corner. diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in index a78e22a8..aed39427 100644 --- a/doc/Doxyfile.in +++ b/doc/Doxyfile.in @@ -38,7 +38,7 @@ PROJECT_NAME = "Flexiv RDK APIs" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.9.2 +PROJECT_NUMBER = 1.9.3 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/include/flexiv/rdk/data.hpp b/include/flexiv/rdk/data.hpp index e0a0bdb9..d25e79f3 100644 --- a/include/flexiv/rdk/data.hpp +++ b/include/flexiv/rdk/data.hpp @@ -481,6 +481,78 @@ struct Coord std::string str() const; }; +/** + * @struct NrtCartesianCmd + * @brief Commands data for a single waypoint in non-real-time Cartesian motion-force control. + * @see Robot::SendCartesianMotionForce(), Robot::SendMultiCartesianMotionForce(). + */ +struct NrtCartesianCmd +{ + /** Default constructor */ + NrtCartesianCmd() = default; + + /** + * @brief Custom constructor. + * @param[in] pose_d Target TCP pose in world frame. + * @param[in] wrench_d Target TCP wrench in the force control reference frame. + * @param[in] twist_d Target TCP twist in world frame. + * @param[in] max_linear_vel Maximum Cartesian linear velocity when moving to the target pose. + * @param[in] max_angular_vel Maximum Cartesian angular velocity when moving to the target pose. + * @param[in] max_linear_acc Maximum Cartesian linear acceleration when moving to the target + * pose. + * @param[in] max_angular_acc Maximum Cartesian angular acceleration when moving to the target + * pose. + */ + NrtCartesianCmd(const std::array& pose_d, + const std::array& wrench_d = {}, + const std::array& twist_d = {}, double max_linear_vel = 0.5, + double max_angular_vel = 1.0, double max_linear_acc = 2.0, double max_angular_acc = 5.0) + : pose_d(pose_d) + , wrench_d(wrench_d) + , twist_d(twist_d) + , max_linear_vel(max_linear_vel) + , max_angular_vel(max_angular_vel) + , max_linear_acc(max_linear_acc) + , max_angular_acc(max_angular_acc) + { + } + + /** Target TCP pose in world frame: \f$ {^{O}T_{TCP}}_{d} \in \mathbb{R}^{7 \times 1} \f$. + * Consists of \f$ \mathbb{R}^{3 \times 1} \f$ position and \f$ \mathbb{R}^{4 \times 1} \f$ + * quaternion: \f$ [x, y, z, q_w, q_x, q_y, q_z]^T \f$. Unit: \f$ [m]:[] \f$ */ + std::array pose_d = {}; + + /** Target TCP wrench in the force control reference frame (configured by + * SetForceControlFrame()): \f$ ^{O}F_d \in \mathbb{R}^{6 \times 1} \f$. The robot will track + * the target wrench using an explicit force controller. Consists of \f$ \mathbb{R}^{3 \times 1} + * \f$ force and \f$ \mathbb{R}^{3 \times 1} \f$ moment: \f$ [f_x, f_y, f_z, m_x, m_y, m_z]^T + * \f$. Unit: \f$ [N]:[Nm] \f$ */ + std::array wrench_d = {}; + + /** Target TCP twist in world frame: \f$ ^{O}\dot{x}_d \in \mathbb{R}^{6 \times 1} \f$. + * Providing properly calculated target twist can improve the robot's overall tracking + * performance at the cost of reduced robustness. Leaving this input 0 can maximize robustness + * at the cost of reduced tracking performance. Consists of \f$ \mathbb{R}^{3 \times 1} \f$ + * linear and \f$ \mathbb{R}^{3 \times 1} \f$ angular velocity. Unit: \f$ [m/s]:[rad/s] \f$ */ + std::array twist_d = {}; + + /** Maximum Cartesian linear velocity when moving to the target pose. A safe value is provided + * as default. Unit: \f$ [m/s] \f$ */ + double max_linear_vel = 0.5; + + /** Maximum Cartesian angular velocity when moving to the target pose. A safe value is provided + * as default. Unit: \f$ [rad/s] \f$ */ + double max_angular_vel = 1.0; + + /** Maximum Cartesian linear acceleration when moving to the target pose. A safe value is + * provided as default. Unit: \f$ [m/s^2] \f$ */ + double max_linear_acc = 2.0; + + /** Maximum Cartesian angular acceleration when moving to the target pose. A safe value is + * provided as default. Unit: \f$ [rad/s^2] \f$ */ + double max_angular_acc = 5.0; +}; + /** Alias of the variant that holds all possible types of data exchanged with Flexiv robots */ using FlexivDataTypes = std::variant, std::vector, std::vector, std::vector, diff --git a/include/flexiv/rdk/mode.hpp b/include/flexiv/rdk/mode.hpp index ae4bcf40..bd96d693 100644 --- a/include/flexiv/rdk/mode.hpp +++ b/include/flexiv/rdk/mode.hpp @@ -99,7 +99,7 @@ enum class Mode * Run non-real-time super primitives, i.e. composite tasks that consist of various components * like motion, force, vision, planning, etc. * @note Non-real-time (NRT) mode. - * @see Robot::SendCartesianMotionForce(). + * @see Robot::SendCartesianMotionForce(), Robot::SendMultiCartesianMotionForce(). */ NRT_SUPER_PRIMITIVE, }; diff --git a/include/flexiv/rdk/robot.hpp b/include/flexiv/rdk/robot.hpp index 1dc50f18..9efe1a49 100644 --- a/include/flexiv/rdk/robot.hpp +++ b/include/flexiv/rdk/robot.hpp @@ -688,13 +688,50 @@ class Robot * the rest axes motion-controlled, then provide target pose for the motion-controlled axes and * target wrench for the force-controlled axes. * @see SetCartesianImpedance(), SetMaxContactWrench(), SetNullSpacePosture(), - * SetForceControlAxis(), SetForceControlFrame(), SetPassiveForceControl(). + * SetForceControlAxis(), SetForceControlFrame(), SetPassiveForceControl(), + * SendMultiCartesianMotionForce(). */ void SendCartesianMotionForce(const std::array& pose, const std::array& wrench = {}, const std::array& velocity = {}, double max_linear_vel = 0.5, double max_angular_vel = 1.0, double max_linear_acc = 2.0, double max_angular_acc = 5.0); + /** + * @brief [Non-blocking] Discretely send Cartesian multi-waypoint motion and/or force commands + * for the robot to track using non-real-time super primitives. The robot will execute the + * provided waypoints sequentially using onboard motion generation. + * @param[in] cart_cmds Non-real-time Cartesian motion/force commands for each waypoint. Each + * element uses the same data layout as a single command in SendCartesianMotionForce(). + * @param[in] joint_pos Sequence of target joint positions [rad] for each waypoint. Each element + * must contain RobotInfo::DoF values, i.e. the full system degrees of freedom including the + * manipulator and any external axes. Size must match [cart_cmds]. + * @throw std::invalid_argument if [cart_cmds] is empty, if [joint_pos] is empty, if + * [cart_cmds] and [joint_pos] do not contain the same number of waypoints, if any waypoint's + * last 4 input parameters is not positive, or if any joint position vector size is not equal + * to RobotInfo::DoF. + * @throw std::logic_error if the robot is not in the correct control mode. + * @throw std::runtime_error if the robot is not operational. + * @note Applicable control modes: NRT_SUPER_PRIMITIVE. + * @warning Same as Flexiv Elements, the target wrench is expressed as wrench sensed at TCP + * instead of wrench exerted by TCP. E.g. commanding f_z = +5 N will make the end-effector move + * towards -Z direction, so that upon contact, the sensed force will be +5 N. + * @par How to achieve pure motion control? + * Use SetForceControlAxis() to disable force control for all Cartesian axes to achieve pure + * motion control. This function does pure motion control by default. + * @par How to achieve pure force control? + * Use SetForceControlAxis() to enable force control for all Cartesian axes to achieve pure + * force control, active or passive. + * @par How to achieve unified motion-force control? + * Use SetForceControlAxis() to enable force control for one or more Cartesian axes and leave + * the rest axes motion-controlled, then provide target pose for the motion-controlled axes and + * target wrench for the force-controlled axes. + * @see SetCartesianImpedance(), SetMaxContactWrench(), SetNullSpacePosture(), + * SetForceControlAxis(), SetForceControlFrame(), SetPassiveForceControl(), + * SendCartesianMotionForce(). + */ + void SendMultiCartesianMotionForce(const std::vector& cart_cmds, + const std::vector>& joint_pos); + /** * @brief [Blocking] Set impedance properties of the robot's Cartesian motion controller * used in the Cartesian motion-force control modes. diff --git a/lib/libflexiv_rdk.aarch64-linux-gnu.a.sha256 b/lib/libflexiv_rdk.aarch64-linux-gnu.a.sha256 index b6eedc22..8817055f 100644 --- a/lib/libflexiv_rdk.aarch64-linux-gnu.a.sha256 +++ b/lib/libflexiv_rdk.aarch64-linux-gnu.a.sha256 @@ -1 +1 @@ -83b76d2264113bf76ae2b514e15c8dea4f9b2e45c39720654db80b73f422248c \ No newline at end of file +2d40ea1dbeefad9ce595bd73bc1475595b44475ce11ee988e43a42e503be2680 \ No newline at end of file diff --git a/lib/libflexiv_rdk.aarch64-linux-gnu.ros2-jazzy.a.sha256 b/lib/libflexiv_rdk.aarch64-linux-gnu.ros2-jazzy.a.sha256 index a66ce05f..ce7b73c6 100644 --- a/lib/libflexiv_rdk.aarch64-linux-gnu.ros2-jazzy.a.sha256 +++ b/lib/libflexiv_rdk.aarch64-linux-gnu.ros2-jazzy.a.sha256 @@ -1 +1 @@ -02b2779df7e98aa91a1b2f41236d201c7e242837fc285c3a1e80cf504d44b752 \ No newline at end of file +86d939d0274d1bf9e25931c8bad4129094c55f597a5d9d9ce59cdd2794727a53 \ No newline at end of file diff --git a/lib/libflexiv_rdk.aarch64-qnx.a.sha256 b/lib/libflexiv_rdk.aarch64-qnx.a.sha256 index 39ac6f4d..5c150f9c 100644 --- a/lib/libflexiv_rdk.aarch64-qnx.a.sha256 +++ b/lib/libflexiv_rdk.aarch64-qnx.a.sha256 @@ -1 +1 @@ -76dbf2b676c18911078101c59760382eb5174e94272c213c22ca1b690c99ef89 \ No newline at end of file +d25a0a3aa5cb0e899f0d03f6a4fd93ad6b6f05f8327826f9a02c172044e820cb \ No newline at end of file diff --git a/lib/libflexiv_rdk.arm64-darwin.a.sha256 b/lib/libflexiv_rdk.arm64-darwin.a.sha256 index 857cd39d..05ec7824 100644 --- a/lib/libflexiv_rdk.arm64-darwin.a.sha256 +++ b/lib/libflexiv_rdk.arm64-darwin.a.sha256 @@ -1 +1 @@ -7786efb7b3ff6d96005f598420e6929658091279664dcd9923ad16094003dcaf \ No newline at end of file +39eb0b0713da0e4a0d40ec5042711865fc07d793f07caccffaffa08520fde08c \ No newline at end of file diff --git a/lib/libflexiv_rdk.x86_64-linux-gnu.a.sha256 b/lib/libflexiv_rdk.x86_64-linux-gnu.a.sha256 index 420d3349..6d2f3cfa 100644 --- a/lib/libflexiv_rdk.x86_64-linux-gnu.a.sha256 +++ b/lib/libflexiv_rdk.x86_64-linux-gnu.a.sha256 @@ -1 +1 @@ -3b1c923b4bed6c1cc94ce774d57071906c5808a30302a5d7d7be40b349c69b58 \ No newline at end of file +ffb1d5168fee0679547d57cb2f2684eee215a5b83695b6f166bbaef97e3059a6 \ No newline at end of file diff --git a/lib/libflexiv_rdk.x86_64-linux-gnu.ros2-jazzy.a.sha256 b/lib/libflexiv_rdk.x86_64-linux-gnu.ros2-jazzy.a.sha256 index 2b7876d8..5c496f8f 100644 --- a/lib/libflexiv_rdk.x86_64-linux-gnu.ros2-jazzy.a.sha256 +++ b/lib/libflexiv_rdk.x86_64-linux-gnu.ros2-jazzy.a.sha256 @@ -1 +1 @@ -49e8a20adec9b56b6263cdf94954cf3414b7a507521f42640208dd5efaf8276d \ No newline at end of file +78bbb621c1261949fdb1b49e8945995fc1777eb739110854ce234e7697e016b4 \ No newline at end of file diff --git a/lib/libflexiv_rdk.x86_64-qnx.a.sha256 b/lib/libflexiv_rdk.x86_64-qnx.a.sha256 index 090369fc..735d1e43 100644 --- a/lib/libflexiv_rdk.x86_64-qnx.a.sha256 +++ b/lib/libflexiv_rdk.x86_64-qnx.a.sha256 @@ -1 +1 @@ -e6b1538f3ec3e6a7bae22c849c48ed33ac3ee348d5fcad4526f3ad79949d3ad9 \ No newline at end of file +46717c0b9e35cf309fd9478cd3273348e88ce171339eab1dec6620b39c7d7961 \ No newline at end of file