Attaching Frames to An Axis
Brief: we add an axis to an axis group and attach two frames to the new axis. The frames could represent key poses attached to a part. We then jog the axis using axis_group_movej
in simulation.
URScript API functions used in this example:
axis_group_add
axis_group_add_axis
axis_group_movej
reset_world_model
add_frame
attach_frame
This example creates an axis group called “positioner” with a single axis. It then demonstrates how to add a frame to the kinematic tree and attach it to the axis. A second frame is then created and attached to the first frame. The axis is commanded to rotate 180 degrees demonstrating that the attached frames move with the axis.
NOTE: This example does not drive any EtherCAT hardware and the external axes move only in the world model.
Resetting the World Model
This removes all axis groups and axes that have been added to the controller’s world. At the end of the program, the axis and groups that have been added remain in the controller’s world model for subsequent programs. Calling reset_world_model()
at the start of a program ensures there is a clean slate if that’s desired. More info: reset_world_model
Adding an Axis Group and an Axis
This creates an axis group called “positioner” and places it in the 0.5m in the x axis of the robot base frame. It then adds a revolute axis called “axis1” to the “positioner” axis group placed 0.3m in the z direction and rotated 90 degrees around the y direction of the “positioner” frame. More info: axis_group_add
and axis_group_add_axis
Attaching the First Frame
This adds a new frame called “frame1” and places it 0.2m in the direction of the “axis1” z axis and with the same orientation as “axis1”. It then attaches “frame1” to “axis1” so that “frame1” will move with “axis1”. (When adding a frame, it is attached to the “world” frame by default). More info: add_frame
and attach_frame
Attach the Second Frame
This adds a new frame called “frame2” and places it 0.2m in the y and z directions of the “axis1” frame. It then attaches “frame2” to “frame1”.
Jog the Axis
This jogs the “axis1” axis that is part of the “positioner” axis group to its 180 degree position using the maximum acceleration and velocity allowed by the axis. It then jogs it back to its 0 degree position.