Control with Python ROS Wrapper

In order to control Ned robot more easily than calling ROS topics & services, a Python ROS Wrapper has been built on top of ROS.
For instance, a script realizing a moveJ via Python ROS Wrapper will looks like:
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))
What the underlying code does:
It generates a RobotMove Action Goal (cf this package for more informations) and set it as a joint command with the corresponding joints value.
Sends the goal to the Commander Action Server.
Waits for the Commander Action Server to set Action as finished.
Checks if the action finished successfully.
In this section, we will give some examples on how to use the Python ROS Wrapper to control Ned robots, as well as a complete documentation of the functions available in the Ned Python ROS Wrapper.
Hint
The Python ROS Wrapper forces the user to write his code directly in the robot, or, at least, copy the code on the robot via a terminal command. If you do not want to do that, and run code directly from your computer you can use the Pyniryo python package.