Examples: Motions

This document shows how to control Ned with Move Joints & Move Pose.

If you want see more about Ned robot’s arm commander package, go to Niryo robot arm commander

Danger

If you are using the real robot, make sure the environment around is clear.

Joints

To do a move joints, you have to call the move() method with a JointsPosition object. A JointsPosition object contains a list of the 6 joints goal positions.

 1#!/usr/bin/env python3
 2
 3from niryo_robot_python_ros_wrapper import NiryoRosWrapper, JointsPosition
 4
 5# Instantiate the ROS wrapper and initialize the ROS node
 6robot = NiryoRosWrapper.init_with_node()
 7
 8# Calibrate if needed
 9robot.calibrate_auto()  # Only for Ned2
10
11# Move the robot
12robot.move(JointsPosition(0.1, -0.2, 0.0, 1.1, -0.5, 0.2))

To get the current joint positions, we use get_joints():

joints = robot.get_joints()
j1, j2, j3, j4, j5, j6 = joints

Poses

To do a move pose, you have to call the move() method with a Pose object. A Pose object contains a list of (x, y, z) values for the end-effector position and (yaw, pitch, roll) for its orientation.

 1#!/usr/bin/env python3
 2
 3from niryo_robot_python_ros_wrapper import NiryoRosWrapper, Pose
 4
 5import math
 6
 7# Instantiate the ROS wrapper and initialize the ROS node
 8robot = NiryoRosWrapper.init_with_node()
 9
10# Calibrate if needed
11robot.calibrate_auto()  # Only for Ned2
12
13# Move the robot
14robot.move(Pose(0.25, 0.0, 0.25, 0.0, math.pi, math.pi / 2))

To get the current pose, we use get_pose():

robot_state = niryo_robot.get_pose_v2()