UniversalRobots / Universal_Robots_ROS_Driver

Universal Robots ROS driver supporting CB3 and e-Series
Apache License 2.0
765 stars 405 forks source link

Windows / WSL support with real hardware #486

Open golftra opened 3 years ago

golftra commented 3 years ago

Just a quick question. Is it possible to set up this driver to run with a real robot on Windows 10 (ROS in Windows natively or ROS in Windows through WSL) ?

Thank you

urrsk commented 3 years ago

@golftra I think so, but I have not tested it. There is an issue on the External Control mention some problems to get it connected, though I believe by directions will resolve the issue. https://github.com/UniversalRobots/Universal_Robots_ExternalControl_URCap/issues/24

But you are more than welcome to contribute, It could be nice with a guide to get it up running.

fmauch commented 2 years ago

Yes, that definitely sounds like an interesting question. We've never tested that, so if you gain any knowledge on that it would be nice if you could share that here :-)

hamyyy commented 2 years ago

Any updates on this? I'm currently trying to control a UR10e using WSL2. I'm able to get join trajectories, and rviz displays and updates the robot correctly in real time. But when i try to start the program on the UR10e it is unable to connect to the host.

MiroslavKohut commented 2 years ago

Any updates on this? I'm currently trying to control a UR10e using WSL2. I'm able to get join trajectories, and rviz displays and updates the robot correctly in real time. But when i try to start the program on the UR10e it is unable to connect to the host.

Please make sure you have turned off your firewall and setup correctly portfowarding. You have to setup porfowarding for all of the ports in your windwos machine:

netsh interface portproxy add v4tov4 listenport=50002 connectport=50002 connectaddress=IP_OF_WSL netsh interface portproxy add v4tov4 listenport=50001 connectport=50001 connectaddress=IP_OF_WSL netsh interface portproxy add v4tov4 listenport=50003 connectport=50003 connectaddress=IP_OF_WSL

IP_OF_WSL always changes after restart so make sure you have setup the correct IP

then you have to set reverse ip to the ip of of your host windows machine because the driver automatically detect IP of WSL and set it as a reverse IP and it is not correct In robot the IP in your URcap should be the IP of your Windows host ... Windows and Robot have to be on same subnet.

Then you will be able to start URcap on your robot and connect successfully.

For controlling the robot you have to do one more thing because the robot will still drop the connection.

For me helps to setup keepalivecount as mentione here

https://github.com/UniversalRobots/Universal_Robots_ROS_Driver/issues/507#issuecomment-1028128431

fmauch commented 2 years ago

@MiroslavKohut So you got the driver running on WSL2? Thank you for posting your experience here, this is a great addition!