Frames
This file presents the different api_doc/frames:Frames - Command functions available with the Frames API
All functions to control the robot are accessible via an instance of the class api_doc/niryo_robot:NiryoRobot
robot = NiryoRobot(<robot_ip_address>)
frames = frames.get_saved_dynamic_frame_list()
...
Frames - Command functions
List of functions subsections:
Frames functions
- class pyniryo2.frames.frames.Frames(client)
- get_saved_dynamic_frame_list()
Get list of saved dynamic frames
Example:
list_frame, list_desc = robot.frames.get_saved_dynamic_frame_list() print(list_frame) print(list_desc)
- Returns:
list of dynamic frames name, list of description of dynamic frames
- Return type:
dictionnaire{name:description}
- get_saved_dynamic_frame(frame_name)
Get name, description and pose of a dynamic frame
Example:
frame = robot.frames.get_saved_dynamic_frame("default_frame")
- Parameters:
frame_name (str) – name of the frame
- Returns:
name, description, position and orientation of a frame
- Return type:
namedtuple(name(str), description(str), position(list[float]), orientation(list[float]))
- save_dynamic_frame_from_poses(frame_name, description, pose_origin, pose_x, pose_y, belong_to_workspace=False)
Create a dynamic frame with 3 poses (origin, x, y)
Example:
pose_o = [0.1, 0.1, 0.1, 0, 0, 0] pose_x = [0.2, 0.1, 0.1, 0, 0, 0] pose_y = [0.1, 0.2, 0.1, 0, 0, 0] robot.frames.save_dynamic_frame_from_poses("name", "une description test", pose_o, pose_x, pose_y)
- Parameters:
frame_name (str) – name of the frame
description (str) – description of the frame
pose_origin (list[float] [x, y, z, roll, pitch, yaw]) – pose of the origin of the frame
pose_x (list[float] [x, y, z, roll, pitch, yaw]) – pose of the point x of the frame
pose_y (list[float] [x, y, z, roll, pitch, yaw]) – pose of the point y of the frame
belong_to_workspace (boolean) – indicate if the frame belong to a workspace
- Returns:
status, message
- Return type:
(int, str)
- save_dynamic_frame_from_points(frame_name, description, point_origin, point_x, point_y, belong_to_workspace=False)
Create a dynamic frame with 3 points (origin, x, y)
Example:
point_o = [-0.1, -0.1, 0.1] point_x = [-0.2, -0.1, 0.1] point_y = [-0.1, -0.2, 0.1] robot.frames.save_dynamic_frame_from_points("name", "une description test", point_o, point_x, point_y)
- Parameters:
frame_name (str) – name of the frame
description (str) – description of the frame
point_origin (list[float] [x, y, z]) – origin point of the frame
point_x (list[float] [x, y, z]) – point x of the frame
point_y (list[float] [x, y, z]) – point y of the frame
belong_to_workspace (boolean) – indicate if the frame belong to a workspace
- Returns:
status, message
- Return type:
(int, str)
- edit_dynamic_frame(frame_name, new_frame_name, new_description)
Modify a dynamic frame
Example:
robot.frames.edit_dynamic_frame("name", "new_name", "new description")
- Parameters:
frame_name (str) – name of the frame
new_frame_name (str) – new name of the frame
new_description (str) – new description of the frame
- Returns:
status, message
- Return type:
(int, str)
- delete_saved_dynamic_frame(frame_name, belong_to_workspace=False)
Delete a dynamic frame
Example:
robot.frames.delete_saved_dynamic_frame("name")
- Parameters:
frame_name (str) – name of the frame to remove
belong_to_workspace (boolean) – indicate if the frame belong to a workspace
- Returns:
status, message
- Return type:
(int, str)