NiryoRos
The NiryoRos class inherits the attributes and functions of roslibpy.Ros. It allows the connection of the program to the ROS Master of the robot via roslibpy. It adds an overlay to manage the versions of the robot and a recognition of the API by the robot which is necessary for the use of certain functions.
- class pyniryo2.niryo_ros.NiryoRos(ip_address='127.0.0.1', port=9090)
Connect to your computer to ros:
ros_instance = NiryoRos("127.0.0.1") # Simulation ros_instance = NiryoRos("10.10.10.10") # Hotspot ros_instance = NiryoRos("169.254.200.201") # Ethernet
Based on the roslibpy ROS client: https://roslibpy.readthedocs.io/en/latest/reference/index.html#roslibpy.Ros
- Parameters:
ip_address (str) – ip of the ros master
port (int) – usually 9090
- close()
Disconnect from ROS.
- terminate()
Signals the termination of the main event loop.
- property hardware_version
Get the hardware version of the robot (one, ned, ned2)
- Returns:
The hardware version of the robot (one, ned, ned2)
- Return type:
str
- exception pyniryo2.niryo_ros.NiryoRosTimeoutException