Hi,
I am using MATLAB 2024a in linux, where I have installed ROS 2 and Dependencies as proposed in here by using the automated method. As can be seen in the picture, evrething seems to work fine.
However, I am trying to connect to the UR simulator, as explained in this example using this script: ur5e = loadrobot('universalUR5e');
ROS2Folder = '/opt/ros/humble';
ROS2Workspace = '/opt/ros/humble';
ROS2DeviceAddress = '192.168.56.1';
robotAddress = '192.168.56.101';
device = ros2device(ROS2DeviceAddress,username,password);
device.ROS2Folder = ROS2Folder;
device.ROS2Workspace = ROS2Workspace;
generateAndTransferLaunchScriptROS2GettingStarted(device,ROS2Workspace,robotAddress);
ur = urROS2Node('RigidBodyTree',ur5e);
and modifying the associated function so it works on simulation:
function generateAndTransferLaunchScriptROS2GettingStarted(device,WorkSpaceFolder,RobotAddress)
fid=fopen(fullfile(tempdir,"launchUR5eROS2.sh"),"w+");
if strcmp(WorkSpaceFolder, device.ROS2Folder)
fprintf(fid,"gnome-terminal --title=\42Simulated UR5e Robot\42 -- /bin/bash -c 'source %s/setup.bash; ros2 launch ur_robot_driver ur5e.launch.py launch_rviz:=false robot_ip:=%s'",device.ROS2Folder,RobotAddress);
fprintf(fid,"gnome-terminal --title=\42Simulated UR5e Robot\42 -- /bin/bash -c 'source %s/setup.bash; source %s/install/setup.bash; ros2 launch ur_robot_driver ur5e.launch.py launch_rviz:=false robot_ip:=%s'",device.ROS2Folder,WorkSpaceFolder,RobotAddress);
putFile(device,fullfile(tempdir,'launchUR5eROS2.sh'),'~/')
system(device,'chmod a+x ~/launchUR5eROS2.sh');
system(device,'./launchUR5eROS2.sh &');
The UR sim loger viewer indicates that the communication is reached.
However, I am getting this error:
Error using ros.internal.getEmptyMessage>getMessageDataAndInfo (line 70)
How could I solve it so I can continue with the example execution?
Screenshot of the Matlab and urSim windows: