ros-teleop / teleop_twist_keyboard

Generic Keyboard Teleop for ROS
256 stars 404 forks source link

ros-teleop can not work in VM(NAT mode) #19

Open SYSUHPK opened 5 years ago

SYSUHPK commented 5 years ago

I am using teleop in VM to control the robotic car, but it doesn't work. The specific situation is as follows: Teleop is installed on Ubuntu of the VM and VM is in NAT mode. The Teleop could work, but the robot could not pick up the instructions from it. If the VM is switched to Bridge mode, Teleop can control and the instructions can be received by robot. This has been bothering me for a long time. I want to ask if you have any suggestions I test the talker and listener example in NAT mode and it can work, it really make me confused.

trainman419 commented 5 years ago

This is a general ROS problem; it's not specific to teleop_twist_keyboard. ROS Network Setup requires full, two way connectivity between the computers or VMs that run ROS nodes. A VM in bridged mode provides full connectivity, but NAT only provides one-way connectivity.

SYSUHPK commented 5 years ago

Thanks a lot, I realize that it is the mechanism of ROS and NAT that cause it. It is impossible to make it by topic, but I want to find a way to make it work(not bridge). I think service maybe work, so I make some attempts:
I run the talker behind NAT while listener out of it. Of course it don't work, then I rewrite them by service and it works. I think maybe the Teleop also can be rewrite by service ?