# A point-to-point motion in the joint space
m1 = JointWaypointMotion([JointWaypoint([-0.3, 0.1, 0.3, -1.4, 0.1, 1.8, 0.7])])
# A motion in joint space with multiple waypoints
m2 = JointWaypointMotion([
JointWaypoint([-0.3, 0.1, 0.3, -1.4, 0.1, 1.8, 0.7]),
JointWaypoint([0.0, 0.3, 0.3, -1.5, -0.2, 1.5, 0.8]),
JointWaypoint([0.1, 0.4, 0.3, -1.4, -0.3, 1.7, 0.9])
])
robot.move(m1)
robot.move(m2)
Whole code.
import math
from scipy.spatial.transform import Rotation
from franky import JointWaypointMotion, JointWaypoint, JointPositionStopMotion, CartesianMotion, \
CartesianWaypointMotion, CartesianWaypoint, Affine, Twist, RobotPose, ReferenceType, CartesianPoseStopMotion, \
CartesianState, JointState
from franky import Robot
robot = Robot("172.16.0.2")
# Recover from errors
robot.recover_from_errors()
# Set velocity, acceleration and jerk to 5% of the maximum
robot.relative_dynamics_factor = 0.05
# A point-to-point motion in the joint space
m1 = JointWaypointMotion([JointWaypoint([-0.3, 0.1, 0.3, -1.4, 0.1, 1.8, 0.7])])
# A motion in joint space with multiple waypoints
m2 = JointWaypointMotion([
JointWaypoint([-0.3, 0.1, 0.3, -1.4, 0.1, 1.8, 0.7]),
JointWaypoint([0.0, 0.3, 0.3, -1.5, -0.2, 1.5, 0.8]),
JointWaypoint([0.1, 0.4, 0.3, -1.4, -0.3, 1.7, 0.9])
])
robot.move(m1)
robot.move(m2)