### Install Robotic Arm Python Package Source: https://develop.realman-robotics.com/robot4th/apipython/getStarted Instructions for installing the Robotic Arm Python package using pip or by cloning the repository. Pip installation is the recommended method for most users. Cloning the repository allows for local development and access to the source code. ```bash pip install Robotic_Arm ``` ```bash git clone https://github.com/RealManRobot/RM_API2.git ``` -------------------------------- ### Connect to Robot Arm and Get Software Info (Python) Source: https://develop.realman-robotics.com/robot4th/apipython/getStarted Example Python code to connect to a RealMan robotic arm, retrieve its software version information, and print details like product version, algorithm library version, control layer software version, dynamics version, and planning layer software version. It includes error handling for cases where information retrieval fails. ```python from Robotic_Arm.rm_robot_interface import * robot = RoboticArm(rm_thread_mode_e.RM_TRIPLE_MODE_E) handle = robot.rm_create_robot_arm("192.168.1.18", 8080) print("机械臂ID:", handle.id) software_info = robot.rm_get_arm_software_info() if software_info[0] == 0: print("\n================== Arm Software Information ==================") print("Arm Model: ", software_info[1]['product_version']) print("Algorithm Library Version: ", software_info[1]['algorithm_info']['version']) print("Control Layer Software Version: ", software_info[1]['ctrl_info']['version']) print("Dynamics Version: ", software_info[1]['dynamic_info']['model_version']) print("Planning Layer Software Version: ", software_info[1]['plan_info']['version']) print("==============================================================\n") else: print("\nFailed to get arm software information, Error code: ", software_info[0], "\n") ``` -------------------------------- ### Get Installation Pose Source: https://develop.realman-robotics.com/robot4th/apipython/classes/installPos Retrieves the current installation pose parameters (rotation, pitch, and yaw angles) of the robotic arm. The returned dictionary includes a status code and the pose values. ```APIDOC ## GET /rm_get_install_pose ### Description Retrieves the current installation pose parameters, including rotation, pitch, and yaw angles, of the robotic arm. The response provides a status code and the corresponding pose values. ### Method GET ### Endpoint /rm_get_install_pose ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **return_code** (int) - 0 indicates success. Other values refer to API2 error codes. - **x** (float) - Rotation angle in degrees. - **y** (float) - Pitch angle in degrees. - **z** (float) - Yaw angle in degrees. #### Response Example ```json { "return_code": 0, "x": 0.0, "y": 90.0, "z": 0.0 } ``` ``` -------------------------------- ### Set Installation Pose Source: https://develop.realman-robotics.com/robot4th/apipython/classes/installPos Configures the installation pose parameters (rotation, pitch, and yaw angles) for the robotic arm. This is crucial as different installation methods affect the robot's dynamics and coordinate system. ```APIDOC ## POST /rm_set_install_pose ### Description Sets the installation pose parameters (rotation, pitch, and yaw angles) for the robotic arm. This configuration is essential as it influences the robot's dynamic model and coordinate system orientation. ### Method POST ### Endpoint /rm_set_install_pose ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **x** (float) - Required - Rotation angle in degrees. - **y** (float) - Required - Pitch angle in degrees. - **z** (float) - Required - Yaw angle in degrees. ### Request Example ```python { "x": 0.0, "y": 90.0, "z": 0.0 } ``` ### Response #### Success Response (200) - **return_code** (int) - 0 indicates success. Other values refer to API2 error codes. #### Response Example ```json { "return_code": 0 } ``` ``` -------------------------------- ### Get Installation Angle Source: https://develop.realman-robotics.com/robot4th/apipython/classes/algo Retrieves the current installation angles (X, Y, Z) of the robot arm. ```APIDOC ## Get Installation Angle ### Description Retrieves the current installation angles (X, Y, Z) of the robot arm. ### Method rm_algo_get_angle() ### Endpoint N/A (Method of the Algo object) ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - None ### Request Example ```python from Robotic_Arm.rm_robot_interface import * arm_model = rm_robot_arm_model_e.RM_MODEL_RM_65_E # RM_65 mechanical arm force_type = rm_force_type_e.RM_MODEL_RM_B_E # Standard version # Initialize the algorithm with the robot arm and end-effector model algo_handle = Algo(arm_model, force_type) # Get the current robot arm installation angles print(algo_handle.rm_algo_get_angle()) ``` ### Response #### Success Response (200) - **x** (float) - The current installation angle around the X-axis in degrees. - **y** (float) - The current installation angle around the Y-axis in degrees. - **z** (float) - The current installation angle around the Z-axis in degrees. #### Response Example ```json [0.0, 90.0, 0.0] ``` ``` -------------------------------- ### Get Installation Pose using rm_get_install_pose() - Python Source: https://develop.realman-robotics.com/robot4th/apipython/classes/installPos Retrieves the current installation pose of the robot arm, including rotation, pitch, and yaw angles. Returns a dictionary containing a status code and the pose angles. This function is useful for verifying or logging the robot's current orientation. ```python from Robotic_Arm.rm_robot_interface import * # 实例化RoboticArm类 arm = RoboticArm(rm_thread_mode_e.RM_TRIPLE_MODE_E) # 创建机械臂连接,打印连接id handle = arm.rm_create_robot_arm("192.168.1.18", 8080) print(handle.id) print(arm.rm_get_install_pose()) arm.rm_delete_robot_arm() ``` -------------------------------- ### Set Installation Pose using rm_set_install_pose() - Python Source: https://develop.realman-robotics.com/robot4th/apipython/classes/installPos Configures the installation pose of the robot arm by setting rotation, pitch, and yaw angles. Requires float inputs for angles in degrees and returns an integer status code. This function is crucial for adjusting the robot's kinematic model based on its mounting orientation. ```python from Robotic_Arm.rm_robot_interface import * # 实例化RoboticArm类 arm = RoboticArm(rm_thread_mode_e.RM_TRIPLE_MODE_E) # 创建机械臂连接,打印连接id handle = arm.rm_create_robot_arm("192.168.1.18", 8080) print(handle.id) print(arm.rm_set_install_pose(0, 90, 0)) arm.rm_delete_robot_arm() ``` -------------------------------- ### Start Multi-Mode Drag Teach - Python Source: https://develop.realman-robotics.com/robot4th/apipython/classes/dragTeach Starts a drag teaching session using a composite mode, defined by the `rm_multi_drag_teach_t` parameter. This allows for more complex teaching scenarios. ```python from Robotic_Arm.rm_robot_interface import * # 实例化RoboticArm类 arm = RoboticArm(rm_thread_mode_e.RM_TRIPLE_MODE_E) # 创建机械臂连接,打印连接id handle = arm.rm_create_robot_arm("192.168.1.18", 8080) print(handle.id) param = rm_multi_drag_teach_t((0, 1, 1, 0, 1, 0), 0, 1) result1 = arm.rm_start_multi_drag_teach_new(param) time.sleep(2) result2 = arm.rm_set_stop_teach() arm.rm_delete_robot_arm() ``` -------------------------------- ### Set Installation Angle Source: https://develop.realman-robotics.com/robot4th/apipython/classes/algo Sets the installation angles (X, Y, Z) for the robot arm. ```APIDOC ## Set Installation Angle ### Description Sets the installation angles (X, Y, Z) for the robot arm. These angles define the orientation of the robot's base. ### Method rm_algo_set_angle() ### Endpoint N/A (Method of the Algo object) ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - **x** (float) - Required - Installation angle around the X-axis in degrees. - **y** (float) - Required - Installation angle around the Y-axis in degrees. - **z** (float) - Required - Installation angle around the Z-axis in degrees. ### Request Example ```python from Robotic_Arm.rm_robot_interface import * arm_model = rm_robot_arm_model_e.RM_MODEL_RM_65_E # RM_65 mechanical arm force_type = rm_force_type_e.RM_MODEL_RM_B_E # Standard version # Initialize the algorithm with the robot arm and end-effector model algo_handle = Algo(arm_model, force_type) # Set the robot arm installation angles algo_handle.rm_algo_set_angle(0, 90, 0) ``` ### Response #### Success Response (200) - None (This method typically returns nothing upon successful execution). #### Response Example ```json null ``` ``` -------------------------------- ### Get Installation Angle - Python Source: https://develop.realman-robotics.com/robot4th/apipython/classes/algo Retrieves the current installation angles of the robot arm for the X, Y, and Z axes in degrees. This function returns a tuple of three floats. It requires an initialized Algo object. ```python from Robotic_Arm.rm_robot_interface import * arm_model = rm_robot_arm_model_e.RM_MODEL_RM_65_E # RM_65机械臂 force_type = rm_force_type_e.RM_MODEL_RM_B_E # 标准版 # 初始化算法的机械臂及末端型号 algo_handle = Algo(arm_model, force_type) # 获取当前算法使用的机械臂安装角度 print(algo_handle.rm_algo_get_angle()) ``` -------------------------------- ### Set Installation Angle - Python Source: https://develop.realman-robotics.com/robot4th/apipython/classes/algo Sets the installation angle of the robot arm in degrees for the X, Y, and Z axes. This is crucial for accurate kinematic calculations. It requires an initialized Algo object and float values for each axis. ```python from Robotic_Arm.rm_robot_interface import * arm_model = rm_robot_arm_model_e.RM_MODEL_RM_65_E # RM_65机械臂 force_type = rm_force_type_e.RM_MODEL_RM_B_E # 标准版 # 初始化算法的机械臂及末端型号 algo_handle = Algo(arm_model, force_type) # 设置当前算法使用的机械臂安装角度 algo_handle.rm_algo_set_angle(0,90,0) ``` -------------------------------- ### Get Algorithm Library Version Source: https://develop.realman-robotics.com/robot4th/apipython/classes/algo Retrieves the current version of the algorithm library. ```APIDOC ## Get Algorithm Library Version ### Description Retrieves the current version of the algorithm library. ### Method rm_algo_version() ### Endpoint N/A (Method of the Algo object) ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - None ### Request Example ```python from Robotic_Arm.rm_robot_interface import * arm_model = rm_robot_arm_model_e.RM_MODEL_RM_65_E # RM_65 mechanical arm force_type = rm_force_type_e.RM_MODEL_RM_B_E # Standard version # Initialize the algorithm with the robot arm and end-effector model algo_handle = Algo(arm_model, force_type) # Get the current algorithm library version print(algo_handle.rm_algo_version()) ``` ### Response #### Success Response (200) - **version** (str) - The version number of the algorithm library. #### Response Example ```json "1.2.3" ``` ``` -------------------------------- ### Start Drag Teach - Python Source: https://develop.realman-robotics.com/robot4th/apipython/classes/dragTeach Initiates the drag teaching process. It allows for the recording of the robot's trajectory during manual movement. The `trajectory_record` parameter determines if the path is saved. ```python from Robotic_Arm.rm_robot_interface import * # 实例化RoboticArm类 arm = RoboticArm(rm_thread_mode_e.RM_TRIPLE_MODE_E) # 创建机械臂连接,打印连接id handle = arm.rm_create_robot_arm("192.168.1.18", 8080) print(handle.id) print(arm.rm_start_drag_teach(1)) arm.rm_delete_robot_arm() ``` -------------------------------- ### Get Initial Pose Source: https://develop.realman-robotics.com/robot4th/apipython/classes/armState Retrieves the currently set initial pose (joint angles) of the robotic arm. ```APIDOC ## Get Initial Pose `rm_get_init_pose()` ### Description Retrieves the initial pose of the robotic arm, which consists of the joint angles set as the default starting position. ### Method Python Function Call ### Endpoint N/A (Local Function Call) ### Parameters None ### Request Example ```python from Robotic_Arm.rm_robot_interface import * arm = RoboticArm(rm_thread_mode_e.RM_TRIPLE_MODE_E) handle = arm.rm_create_robot_arm("192.168.1.18", 8080) print(arm.rm_get_init_pose()) arm.rm_delete_robot_arm() ``` ### Response #### Success Response (200) - **status_code** (int) - 0 for success, other codes indicate errors. - **initial_pose** (list[float]) - A list containing the joint angles (in degrees) for the initial pose. #### Response Example ```json { "status_code": 0, "initial_pose": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] } ``` ``` -------------------------------- ### POST /rm_set_program_id_run Source: https://develop.realman-robotics.com/robot4th/apipython/classes/projectManagement Starts running a specified online programming file by its ID. Allows control over speed and blocking behavior. ```APIDOC ## POST /rm_set_program_id_run ### Description Starts running a specified online programming file by its ID. Allows control over speed and blocking behavior. ### Method POST ### Endpoint /rm_set_program_id_run ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **tra_id** (int) - Required - The ID of the trajectory to run (1-100). - **speed** (int) - Required - The speed to run the trajectory (1-100). If 0, uses the stored speed. - **timeout** (int) - Required - Blocking setting. 0 for non-blocking (multi-thread) or single-thread. Other values for blocking with timeout in seconds (single-thread). ### Request Example ```python { "tra_id": 8, "speed": 20, "timeout": 1 } ``` ### Response #### Success Response (200) - **status_code** (int) - The status code of the function execution. 0 indicates success. #### Response Example ```json { "status_code": 0 } ``` #### Error Responses - **1**: Controller returned false, invalid parameters or robot state error. Recommended actions: Validate JSON command, check robot state. - **-1**: Data sending failed, communication issue. Recommended actions: Check network connectivity. - **-2**: Data receiving failed, communication issue or controller timeout. Recommended actions: Check network connectivity, check version compatibility. - **-3**: Return value parsing failed, incorrect or incomplete data format. Recommended actions: Check version compatibility. - **-4**: Run state stopped but success not received, trajectory may have been stopped externally. ``` -------------------------------- ### Get Arm Software Info in Python Source: https://develop.realman-robotics.com/robot4th/apipython/classes/controllerConfig Retrieves the software version information for the robotic arm. The function returns a tuple containing a status code and a dictionary with software version details. ```python from Robotic_Arm.rm_robot_interface import * # 实例化RoboticArm类 arm = RoboticArm(rm_thread_mode_e.RM_TRIPLE_MODE_E) # 创建机械臂连接,打印连接id handle = arm.rm_create_robot_arm("192.168.1.18", 8080) print(handle.id) print(arm.rm_get_arm_software_info()) arm.rm_delete_robot_arm() ``` -------------------------------- ### GET /effectorIOConfig/get_voltage Source: https://develop.realman-robotics.com/robot4th/apipython/classes/effectorIOConfig Retrieves the current voltage output setting of the power supply port on the robot's end effector. ```APIDOC ## GET /effectorIOConfig/get_voltage ### Description Retrieves the current voltage output setting of the power supply port on the robot's end effector. ### Method GET ### Endpoint /effectorIOConfig/get_voltage ### Response #### Success Response (200) - **status_code** (int) - 0 for success, other codes indicate errors. - **voltage_type** (int) - The current voltage output type (0 for 0V, 2 for 12V, 3 for 24V). #### Response Example ```json { "status_code": 0, "voltage_type": 3 } ``` ``` -------------------------------- ### Get System Runtime in Python Source: https://develop.realman-robotics.com/robot4th/apipython/classes/controllerConfig Retrieves the cumulative runtime of the controller. The function returns a dictionary containing the day, hour, minute, and second of the total runtime, along with a status code. ```python from Robotic_Arm.rm_robot_interface import * # 实例化RoboticArm类 arm = RoboticArm(rm_thread_mode_e.RM_TRIPLE_MODE_E) # 创建机械臂连接,打印连接id handle = arm.rm_create_robot_arm("192.168.1.18", 8080) print(handle.id) print(arm.rm_get_system_runtime()) arm.rm_delete_robot_arm() ``` -------------------------------- ### Get UDP Robot Arm State Push Configuration Source: https://develop.realman-robotics.com/robot4th/apipython/classes/udpConfig Retrieves the current UDP configuration for real-time robot arm status push. This allows users to verify the active settings. ```APIDOC ## GET /rm_get_realtime_push ### Description Queries and returns the current UDP robot arm state push configuration. ### Method GET ### Endpoint /rm_get_realtime_push ### Parameters None ### Request Example ```python from Robotic_Arm.rm_robot_interface import * arm = RoboticArm(rm_thread_mode_e.RM_TRIPLE_MODE_E) handle = arm.rm_create_robot_arm("192.168.1.18", 8080) print(arm.rm_get_realtime_push()) arm.rm_delete_robot_arm() ``` ### Response #### Success Response (200) - **status_code** (int) - 0 indicates success. Other codes represent errors. - **config_data** (dict[str, any]) - A dictionary containing the current UDP push configuration. Keys correspond to the fields in `rm_realtime_push_config_t`. #### Response Example ```json { "status_code": 0, "config_data": { "interval_ms": 100, "enable": true, "port": 8089, "coord_transform": 0, "ip_address": "192.168.1.104", "custom_config": { "joint_speed": 0, "lift_state": 0, "expand_state": 0 } } } ``` ``` -------------------------------- ### Algo Initialization Source: https://develop.realman-robotics.com/robot4th/apipython/classes/algo Initializes the algorithm library with the specified robot arm model and force sensor type. ```APIDOC ## Algo Initialization ### Description Initializes the algorithm library with the specified robot arm model and force sensor type. ### Method __init__ ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - **arm_model** (rm_robot_arm_model_e) - Required - The model of the robot arm. - **force_type** (rm_force_type_e) - Required - The model of the force sensor. ### Request Example ```python from Robotic_Arm.rm_robot_interface import * arm_model = rm_robot_arm_model_e.RM_MODEL_RM_65_E # RM_65 mechanical arm force_type = rm_force_type_e.RM_MODEL_RM_B_E # Standard version # Initialize the algorithm with the robot arm and end-effector model algo_handle = Algo(arm_model, force_type) ``` ### Response #### Success Response (200) - None (Initialization is typically synchronous and does not return data on success) #### Response Example ```json null ``` ``` -------------------------------- ### Controller Configuration API Source: https://develop.realman-robotics.com/robot4th/apipython/classes/controllerConfig This section details the API endpoints for system configuration, including retrieving controller status, managing power, and accessing runtime and software information. ```APIDOC ## GET /rm_get_controller_state ### Description Retrieves the current state of the robotic arm controller, including voltage, current, temperature, and system error codes. ### Method GET ### Endpoint /rm_get_controller_state ### Parameters #### Query Parameters None #### Request Body None ### Response #### Success Response (200) - **status_code** (int) - Function execution status code (0 for success). - **system_status** (dict) - Dictionary containing system status information: - **voltage** (float) - Current voltage. - **current** (float) - Current consumption. - **temperature** (float) - Controller temperature. - **sys_err** (int) - System error code. #### Response Example ```json { "status_code": 0, "system_status": { "voltage": 24.5, "current": 1.2, "temperature": 45.0, "sys_err": 0 } } ``` ``` ```APIDOC ## POST /rm_set_arm_power ### Description Sets the power state of the robotic arm. Can be used to turn the arm on or off. ### Method POST ### Endpoint /rm_set_arm_power ### Parameters #### Query Parameters None #### Request Body - **power** (int) - Required - Power state: 1 for ON, 0 for OFF. ### Response #### Success Response (200) - **status_code** (int) - Function execution status code (0 for success). #### Response Example ```json { "status_code": 0 } ``` ``` ```APIDOC ## GET /rm_get_arm_power_state ### Description Retrieves the current power state of the robotic arm. ### Method GET ### Endpoint /rm_get_arm_power_state ### Parameters #### Query Parameters None #### Request Body None ### Response #### Success Response (200) - **status_code** (int) - Function execution status code (0 for success). - **power_state** (int) - Robotic arm power state: 1 for ON, 0 for OFF. #### Response Example ```json { "status_code": 0, "power_state": 1 } ``` ``` ```APIDOC ## GET /rm_get_system_runtime ### Description Retrieves the cumulative runtime of the controller in days, hours, minutes, and seconds. ### Method GET ### Endpoint /rm_get_system_runtime ### Parameters #### Query Parameters None #### Request Body None ### Response #### Success Response (200) - **status_code** (int) - Function execution status code (0 for success). - **runtime** (dict) - Dictionary containing runtime information: - **day** (int) - Cumulative days. - **hour** (int) - Cumulative hours. - **min** (int) - Cumulative minutes. - **sec** (int) - Cumulative seconds. #### Response Example ```json { "status_code": 0, "runtime": { "day": 5, "hour": 12, "min": 30, "sec": 45 } } ``` ``` ```APIDOC ## POST /rm_clear_system_runtime ### Description Clears the cumulative runtime counter for the controller. ### Method POST ### Endpoint /rm_clear_system_runtime ### Parameters #### Query Parameters None #### Request Body None ### Response #### Success Response (200) - **status_code** (int) - Function execution status code (0 for success). #### Response Example ```json { "status_code": 0 } ``` ``` ```APIDOC ## GET /rm_get_joint_odom ### Description Retrieves the cumulative rotation angle for each joint of the robotic arm. ### Method GET ### Endpoint /rm_get_joint_odom ### Parameters #### Query Parameters None #### Request Body None ### Response #### Success Response (200) - **status_code** (int) - Function execution status code (0 for success). - **joint_angles** (list[float]) - A list of cumulative rotation angles for each joint. #### Response Example ```json { "status_code": 0, "joint_angles": [ 1.57, -0.78, 0.0, 1.04, 0.0, 0.0 ] } ``` ``` ```APIDOC ## POST /rm_clear_joint_odom ### Description Clears the cumulative rotation angle for all joints of the robotic arm. ### Method POST ### Endpoint /rm_clear_joint_odom ### Parameters #### Query Parameters None #### Request Body None ### Response #### Success Response (200) - **status_code** (int) - Function execution status code (0 for success). #### Response Example ```json { "status_code": 0 } ``` ``` ```APIDOC ## GET /rm_get_arm_software_info ### Description Retrieves the software version information for the robotic arm. ### Method GET ### Endpoint /rm_get_arm_software_info ### Parameters #### Query Parameters None #### Request Body None ### Response #### Success Response (200) - **status_code** (int) - Function execution status code (0 for success). - **software_info** (dict) - A dictionary containing the robotic arm's software version details. #### Response Example ```json { "status_code": 0, "software_info": { "version": "1.2.3", "build_date": "2023-10-27" } } ``` ``` -------------------------------- ### Python: Get Specific Work Coordinate System Pose Source: https://develop.realman-robotics.com/robot4th/apipython/classes/workCoordinateConfig Retrieves the pose of a specified work coordinate system by its name. It returns a tuple containing a status code and the pose list. This function is used to get the exact transformation of a named coordinate system. ```python from Robotic_Arm.rm_robot_interface import * # Instantiate RoboticArm class arm = RoboticArm(rm_thread_mode_e.RM_TRIPLE_MODE_E) ``` -------------------------------- ### Start Force-Position Hybrid Control Compensation (Python) Source: https://develop.realman-robotics.com/robot4th/apipython/classes/forcePositionControl Enables the force-position hybrid control compensation mode. This function initiates the compensation process and returns a status code indicating success or failure. It requires instantiation of the RoboticArm class and establishing a connection. ```python from Robotic_Arm.rm_robot_interface import * # 实例化RoboticArm类 arm = RoboticArm(rm_thread_mode_e.RM_TRIPLE_MODE_E) # 创建机械臂连接,打印连接id handle = arm.rm_create_robot_arm("192.168.1.18", 8080) print(handle.id) print(arm.rm_start_force_position_move()) arm.rm_delete_robot_arm() ``` -------------------------------- ### GET /api/robotarm/singularity_avoidance Source: https://develop.realman-robotics.com/robot4th/apipython/classes/tipVelocityParameters Retrieves the current singularity avoidance mode of the robotic arm. ```APIDOC ## GET /api/robotarm/singularity_avoidance ### Description Retrieves the current singularity avoidance mode of the robotic arm. This allows checking the active singularity avoidance setting. ### Method GET ### Endpoint /api/robotarm/singularity_avoidance ### Parameters None ### Request Example None ### Response #### Success Response (200) - **status_code** (int) - The status code of the operation. 0 indicates success. - **current_mode** (int) - The current singularity avoidance mode. 0 for no avoidance, 1 for avoidance. #### Response Example ```json { "status_code": 0, "current_mode": 1 } ``` ``` -------------------------------- ### Switch Teaching Motion Coordinate System Source: https://develop.realman-robotics.com/robot4th/apipython/classes/teachMove Switches the coordinate system used for teaching motions. It accepts an integer parameter where 0 indicates working coordinate system and 1 indicates tool coordinate system. Returns an integer status code. ```python from Robotic_Arm.rm_robot_interface import * # Instantiate RoboticArm class arm = RoboticArm(rm_thread_mode_e.RM_TRIPLE_MODE_E) # Create robot arm connection, print connection id handle = arm.rm_create_robot_arm("192.168.1.18", 8080) print(handle.id) # Switch teaching coordinate system to the current tool coordinate system print(arm.rm_set_teach_frame(1)) arm.rm_delete_robot_arm() ``` -------------------------------- ### GET /api/robotarm/dh_parameters Source: https://develop.realman-robotics.com/robot4th/apipython/classes/tipVelocityParameters Retrieves the current Denavit-Hartenberg (DH) parameters of the robotic arm. ```APIDOC ## GET /api/robotarm/dh_parameters ### Description Retrieves the current Denavit-Hartenberg (DH) parameters of the robotic arm. This is useful for understanding the robot's current kinematic configuration. ### Method GET ### Endpoint /api/robotarm/dh_parameters ### Parameters None ### Request Example None ### Response #### Success Response (200) - **status_code** (int) - The status code of the operation. 0 indicates success. - **dh_parameters** (object) - The current DH parameters. - **a** (list of float) - Link lengths. - **d** (list of float) - Link offsets. - **alpha** (list of float) - Link twists. - **offset** (list of float) - Joint offsets. #### Response Example ```json { "status_code": 0, "dh_parameters": { "a": [0.0, 0.5, 0.0, 0.0, 0.0, 0.0], "d": [0.1, 0.0, 0.0, 0.2, 0.0, 0.0], "alpha": [0.0, 1.5708, 0.0, 0.0, 1.5708, 0.0], "offset": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0] } } ``` ``` -------------------------------- ### GET /api/robotarm/max_angular_acceleration Source: https://develop.realman-robotics.com/robot4th/apipython/classes/tipVelocityParameters Retrieves the maximum angular acceleration of the robotic arm's end-effector. ```APIDOC ## GET /api/robotarm/max_angular_acceleration ### Description Retrieves the maximum angular acceleration of the robotic arm's end-effector. This parameter is important for controlling the rate of change of angular velocity. ### Method GET ### Endpoint /api/robotarm/max_angular_acceleration ### Parameters None ### Request Example None ### Response #### Success Response (200) - **status_code** (int) - The status code of the operation. 0 indicates success. - **max_angular_acceleration** (float) - The maximum angular acceleration in rad/s^2. #### Response Example { "status_code": 0, "max_angular_acceleration": 10.0 } ``` -------------------------------- ### Instantiate RoboticArm and Connect Source: https://develop.realman-robotics.com/robot4th/apipython/classes/workCoordinateConfig This snippet demonstrates how to instantiate the RoboticArm class and establish a connection to the robot arm. It includes creating a robot arm connection and printing its ID. Dependencies include the RoboticArm class and rm_thread_mode_e enum. ```python from Robotic_Arm.rm_robot_interface import * # 实例化RoboticArm类 arm = RoboticArm(rm_thread_mode_e.RM_TRIPLE_MODE_E) # 创建机械臂连接,打印连接id handle = arm.rm_create_robot_arm("192.168.1.18", 8080) print(handle.id) ``` -------------------------------- ### POST /effectorIOConfig/set_voltage Source: https://develop.realman-robotics.com/robot4th/apipython/classes/effectorIOConfig Configures the voltage output for the power supply port on the robot's end effector. ```APIDOC ## POST /effectorIOConfig/set_voltage ### Description Sets the voltage output for the power supply port on the robot's end effector. ### Method POST ### Endpoint /effectorIOConfig/set_voltage ### Parameters #### Request Body - **voltage_type** (int) - Required - The desired voltage output (0 for 0V, 2 for 12V, 3 for 24V). ### Request Example ```json { "voltage_type": 3 } ``` ### Response #### Success Response (200) - **status_code** (int) - 0 for success, other codes indicate errors. #### Response Example ```json { "status_code": 0 } ``` ``` -------------------------------- ### GET /api/robotarm/max_angular_speed Source: https://develop.realman-robotics.com/robot4th/apipython/classes/tipVelocityParameters Retrieves the maximum angular speed of the robotic arm's end-effector. ```APIDOC ## GET /api/robotarm/max_angular_speed ### Description Retrieves the maximum angular speed of the robotic arm's end-effector. This is crucial for controlling rotational movements and preventing excessive speeds. ### Method GET ### Endpoint /api/robotarm/max_angular_speed ### Parameters None ### Request Example None ### Response #### Success Response (200) - **status_code** (int) - The status code of the operation. 0 indicates success. - **max_angular_speed** (float) - The maximum angular speed in rad/s. #### Response Example { "status_code": 0, "max_angular_speed": 2.1 } ``` -------------------------------- ### GET /api/robotarm/max_line_acceleration Source: https://develop.realman-robotics.com/robot4th/apipython/classes/tipVelocityParameters Retrieves the maximum linear acceleration of the robotic arm's end-effector. ```APIDOC ## GET /api/robotarm/max_line_acceleration ### Description Retrieves the maximum linear acceleration of the robotic arm's end-effector. This value is typically used for trajectory planning and ensuring safe operation. ### Method GET ### Endpoint /api/robotarm/max_line_acceleration ### Parameters None ### Request Example None ### Response #### Success Response (200) - **status_code** (int) - The status code of the operation. 0 indicates success. - **max_linear_acceleration** (float) - The maximum linear acceleration in m/s^2. #### Response Example { "status_code": 0, "max_linear_acceleration": 5.5 } ``` -------------------------------- ### Move Robotic Arm in Cartesian Space using rm_movep_follow Source: https://develop.realman-robotics.com/robot4th/apipython/classes/movePlan This example shows how to move the robotic arm in Cartesian space using the rm_movep_follow function. It establishes a connection, executes two different Cartesian poses (one using Euler angles, the other potentially with Quaternion interpretation based on list length), waits for completion, and then disconnects. The pose list can represent either Euler angles (length 6) or Quaternions (length 7). ```python from Robotic_Arm.rm_robot_interface import * import time # 实例化RoboticArm类 arm = RoboticArm(rm_thread_mode_e.RM_TRIPLE_MODE_E) # 创建机械臂连接,打印连接id handle = arm.rm_create_robot_arm("192.168.1.18", 8080) print(handle.id) print(arm.rm_movep_follow([0,0,0.879,0,0,0])) time.sleep(2) print(arm.rm_movep_follow([0.3, 0, 0.3, 3.14, 0, 0])) time.sleep(2) arm.rm_delete_robot_arm() ``` -------------------------------- ### Get Arm All State Source: https://develop.realman-robotics.com/robot4th/apipython/classes/armState Retrieves all status information for the robotic arm. ```APIDOC ## Get Arm All State `rm_get_arm_all_state()` ### Description Retrieves a comprehensive set of status information for the robotic arm. This includes all parameters defined in `rm_arm_all_state_t`. ### Method Python Function Call ### Endpoint N/A (Local Function Call) ### Parameters None ### Request Example ```python from Robotic_Arm.rm_robot_interface import * arm = RoboticArm(rm_thread_mode_e.RM_TRIPLE_MODE_E) handle = arm.rm_create_robot_arm("192.168.1.18", 8080) print(arm.rm_get_arm_all_state()) arm.rm_delete_robot_arm() ``` ### Response #### Success Response (200) - **status_code** (int) - 0 for success, other codes indicate errors. - **arm_all_state** (dict) - A dictionary containing all status information for the robotic arm. Keys correspond to parameters of `rm_arm_all_state_t`. #### Response Example ```json { "status_code": 0, "arm_all_state": { "current_arm_state": {...}, "current_joint_temperature": [...], "current_joint_current": [...], "current_joint_voltage": [...], "init_pose": [...], "joint_degree": [...] } } ``` ``` -------------------------------- ### Initialize Algorithm Interface - Python Source: https://develop.realman-robotics.com/robot4th/apipython/classes/algo Initializes the algorithm interface for a specific robot arm model and force sensor type. This is a prerequisite for using other algorithm functions. It requires specifying the arm model and force sensor type using provided enumeration types. ```python from Robotic_Arm.rm_robot_interface import * arm_model = rm_robot_arm_model_e.RM_MODEL_RM_65_E # RM_65机械臂 force_type = rm_force_type_e.RM_MODEL_RM_B_E # 标准版 # 初始化算法的机械臂及末端型号 algo_handle = Algo(arm_model, force_type) ``` -------------------------------- ### Get All IO Input States for Robot Controller (Python) Source: https://develop.realman-robotics.com/robot4th/apipython/classes/controllerIOConfig Fetches the status of all four digital input ports on the robot controller. It returns a tuple containing a status code and a list representing the state of each input (high, low, or not configured as input). This is useful for reading signals from external sensors. ```python from Robotic_Arm.rm_robot_interface import * # 实例化RoboticArm类 arm = RoboticArm(rm_thread_mode_e.RM_TRIPLE_MODE_E) # 创建机械臂连接,打印连接id handle = arm.rm_create_robot_arm("192.168.1.18", 8080) print(handle.id) # 获取IO输入状态 print(arm.rm_get_io_input()) arm.rm_delete_robot_arm() ``` -------------------------------- ### GET /rm_get_program_trajectory_list Source: https://develop.realman-robotics.com/robot4th/apipython/classes/projectManagement Retrieves a list of online programming trajectories with support for pagination and fuzzy searching. ```APIDOC ## GET /rm_get_program_trajectory_list ### Description Retrieves a list of online programming trajectories with support for pagination and fuzzy searching. ### Method GET ### Endpoint /rm_get_program_trajectory_list ### Parameters #### Path Parameters None #### Query Parameters - **page_num** (int) - Required - The page number. - **page_size** (int) - Required - The number of items per page. - **vague_search** (str) - Required - The fuzzy search string. ### Request Example ``` GET /rm_get_program_trajectory_list?page_num=1&page_size=10&vague_search=a ``` ### Response #### Success Response (200) - **status_code** (int) - The status code of the function execution. 0 indicates success. - **trajectory_list** (dict[str, any]) - A dictionary containing the retrieved online programming trajectories. Keys correspond to fields of the rm_program_trajectorys_t structure. #### Response Example ```json { "status_code": 0, "trajectory_list": { "rm_program_trajectorys_t": [ { "id": 1, "name": "program1", "speed": 50 } ] } } ``` ``` -------------------------------- ### Get Current Tool Frame Source: https://develop.realman-robotics.com/robot4th/apipython/classes/algo Retrieves the currently active tool coordinate system. ```APIDOC ## Get Current Tool Frame ### Description Retrieves the currently active tool coordinate system. This is the reference frame for the end-effector. ### Method rm_algo_get_curr_toolframe() ### Endpoint N/A (Method of the Algo object) ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - None ### Request Example ```python from Robotic_Arm.rm_robot_interface import * arm_model = rm_robot_arm_model_e.RM_MODEL_RM_65_E # RM_65 mechanical arm force_type = rm_force_type_e.RM_MODEL_RM_B_E # Standard version # Initialize the algorithm with the robot arm and end-effector model algo_handle = Algo(arm_model, force_type) # Set the current tool frame (example) frame = rm_frame_t("", [0.186350, 0.062099, 0.2, 3.141, 0, 1.569], 5, 1, 1, 1) algo_handle.rm_algo_set_toolframe(frame) # Get the current tool frame print(algo_handle.rm_algo_get_curr_toolframe()) ``` ### Response #### Success Response (200) - **tool_frame** (dict[str, any]) - A dictionary representing the current tool coordinate system. Keys correspond to fields in the `rm_frame_t` structure. #### Response Example ```json { "name": "", "translation_rotation_and_scale": [0.186350, 0.062099, 0.2, 3.141, 0, 1.569], "x_scale": 5.0, "y_scale": 1.0, "z_scale": 1.0, "valid": true } ``` ``` -------------------------------- ### Configure UDP Robot Status Push (Python) Source: https://develop.realman-robotics.com/robot4th/apipython/struct/realtimePushConfig Sets up the configuration for actively broadcasting robot status over UDP. Allows customization of broadcast cycle, enable/disable status reporting, target port, coordinate system for external force data, custom IP addresses, and specific data items to report. ```Python class rm_realtime_push_config_t: def __init__(self, cycle: int = None, enable: bool = None, port: int = None, force_coordinate: int = None, ip: str = None, custom_config = None): # ... constructor implementation ... pass def to_dict(self, recurse: bool = True) -> dict: # ... method implementation ... return {} ``` -------------------------------- ### Get Current Work Frame Source: https://develop.realman-robotics.com/robot4th/apipython/classes/algo Retrieves the currently active work coordinate system. ```APIDOC ## Get Current Work Frame ### Description Retrieves the currently active work coordinate system. This is the reference frame for subsequent robot commands. ### Method rm_algo_get_curr_workframe() ### Endpoint N/A (Method of the Algo object) ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - None ### Request Example ```python from Robotic_Arm.rm_robot_interface import * arm_model = rm_robot_arm_model_e.RM_MODEL_RM_65_E # RM_65 mechanical arm force_type = rm_force_type_e.RM_MODEL_RM_B_E # Standard version # Initialize the algorithm with the robot arm and end-effector model algo_handle = Algo(arm_model, force_type) # Set the current work frame (example) frame = rm_frame_t("", [0.186350, 0.062099, 0.2, 3.141, 0, 1.569]) algo_handle.rm_algo_set_workframe(frame) # Get the current work frame print(algo_handle.rm_algo_get_curr_workframe()) ``` ### Response #### Success Response (200) - **work_frame** (dict[str, any]) - A dictionary representing the current work coordinate system. Keys correspond to fields in the `rm_frame_t` structure. #### Response Example ```json { "name": "", "translation_rotation_and_scale": [0.186350, 0.062099, 0.2, 3.141, 0, 1.569], "x_scale": 1.0, "y_scale": 1.0, "z_scale": 1.0, "valid": true } ``` ``` -------------------------------- ### Get Teaching Reference Coordinate System Source: https://develop.realman-robotics.com/robot4th/apipython/classes/teachMove Retrieves the current reference coordinate system being used for teaching. It returns a tuple containing a status code and an integer representing the coordinate system (0 for working, 1 for tool). ```python from Robotic_Arm.rm_robot_interface import * # Instantiate RoboticArm class arm = RoboticArm(rm_thread_mode_e.RM_TRIPLE_MODE_E) # Create robot arm connection, print connection id handle = arm.rm_create_robot_arm("192.168.1.18", 8080) print(handle.id) # Get the current teaching coordinate system print(arm.rm_get_teach_frame()) arm.rm_delete_robot_arm() ``` -------------------------------- ### Get Current Joint Temperature Source: https://develop.realman-robotics.com/robot4th/apipython/classes/armState Retrieves the current temperature of each joint in the robotic arm. ```APIDOC ## Get Current Joint Temperature `rm_get_current_joint_temperature()` ### Description Retrieves the current temperature for each joint of the robotic arm. The temperatures are returned as a list of floating-point numbers. ### Method Python Function Call ### Endpoint N/A (Local Function Call) ### Parameters None ### Request Example ```python from Robotic_Arm.rm_robot_interface import * arm = RoboticArm(rm_thread_mode_e.RM_TRIPLE_MODE_E) handle = arm.rm_create_robot_arm("192.168.1.18", 8080) print(arm.rm_get_current_joint_temperature()) arm.rm_delete_robot_arm() ``` ### Response #### Success Response (200) - **status_code** (int) - 0 for success, other codes indicate errors. - **joint_temperatures** (list[float]) - A list containing the temperature (in Celsius) for joints 1 through 7. #### Response Example ```json { "status_code": 0, "joint_temperatures": [35.5, 36.1, 34.9, 35.2, 37.0, 36.5, 35.8] } ``` ```