The following steps enable using the 'universalrobot' or 'urROSNode' API.
1. Steps to follow in ROS environment:
To initiate the ROS Driver on the ROS Machine, follow these steps on your Ubuntu PC:
Note: `ROS_HOST_IP` refers to the IP address of the machine on which ROS is operating, while the `Robot IP` denotes the IP address of the robot.
- Perform the following in the Ubuntu terminal,
- ~/ur_ws$ source devel/setup.bash
- ~/ur_ws$ export ROS_IP=192.168.X.X
For URSim use the following launch command,
- ~/ur_ws$ roslaunch ur_robot_driver ur5e_bringup.launch robot_ip:=127.0.0.1
For Gazebo use,
- ~/ur_ws$ roslaunch ur_gazebo ur5e_bringup.launch
2. Verify if action server is up on terminal using rostopic list,
- rostopic list must show the following action servers with actions cancel, feedback, etc,
- -- For URSim : pos_joint_traj_controller and scaled_ pos_joint_traj_controller
- -- For Gazebo : pos_joint_traj_controller
- If these are not visible, please re-launch the ur-driver using above command.
- This confirms the action server is up and running.
2. Steps to follow in MATLAB:
Perform the following steps to verify if MATLAB detects action server.
- Recommended workflow is to follow the hardware setup screens to register the dashboard_msgs in MATLAB, alternatively this can done using the following command,
>> status = codertarget.manipROSInterface.addCustomROSmsg('ur')
2. Creating the ‘ur’ object, replace X.X with actual IP
>> ur = urROSNode(“192.168.X.X”)
3. Steps to Troubleshoot Issues with Creating universalrobot API
If the issue still persist, the network settings need to be updated,
To address this, it is recommended to update the setting of Windows network to 'Private' and configuring the virtual machine (VM) to use a 'Bridged Network' following the steps below,
- Windows: Change the Network & Internet settings to Private network as seen the image below, for detailed steps refer to Make a Wi-Fi network public or private in Windows - Microsoft Support
2. VM: Switch the Network settings to Bridged and wait for about 2 minutes to see the IP address update.
Now follow steps 1 and 2 from above to use the 'universalrobot' or 'urROSNode' API.