I have an old robot that only works with Ubuntu 14.04 and Python 2. The robot arm is controlled using ROS1. I wish to program the robot using python 3. I cannot upgrade the robot or its operating system. I am thinking of connecting another laptop to the robot laptop to send and receive data to and from that laptop simultaneously. I would like my main laptop to work with higher version of ubuntu like 18.04 and does all the calculation in python 3 and only send the final data to the laptop connected to the robot. Then robot laptop gets data from the robot sensor and sends it back to the main laptop. This must be done in a loop without user intervention. I am wondering if this method is basically possible? is it possible that two computers send and receive data like that? It is OK if they send data in the form of text files since I work with Python and can read from files but I do not know if basically, this method is possible. If not possible, do you have any other solution or suggestion for my problem? Thank you.
Asked
Active
Viewed 604 times
0
-
3Please read before Close Vote: This question is about using a newer supported version of Ubuntu (such as 20.04) to connect to a different machine that happens to have an older version of Ubuntu. My interpretation is that since this question is asking how to connect a supported Ubuntu version, we could consider this to be in scope for AU. – Enterprise May 25 '21 at 18:18
-
In addition to the answers below, consider using a Patch Cable (if the machines are close enough to allow this). A patch cable will give you much better performance for real time communication between the machines. – Enterprise May 25 '21 at 18:21
-
@PJSingh Maybe a recent version (like 20.04) should be mentioned explicitly in the text of the question, on in the tags, to stop people from thinking this is a question about unsupported release? – raj May 25 '21 at 18:22
-
1Define "real time", i.e. the deadline for action/response beyond which the action is meaningless (too late to stop the arm etc.). Different connection protocols may have built-in delays which might eliminate some. How is the current robot/sensor controlled (USB, GPIO,...)? – ubfan1 May 25 '21 at 18:22
-
NT ME, @raj has a good pint. Please Edit your question, add the Ubuntu version from your newer machine. In addition to ensuring that your question is not flagged for being out of scope, this will help folks give you the best answer for your particular situation. – Enterprise May 25 '21 at 18:24
-
Thanks for the comments. I edited my question. – NT ME May 25 '21 at 20:09
-
Can you explain more about Patch Cable? My computers are close enough to be connected by a cable or FiWi. If this is an easier solution than Python Socket, I prefer to go with it because I have done some work with sockets and have not been successful yet. Thanks – NT ME May 25 '21 at 20:13
-
Ubuntu 20.04 offers ROS1 with python3. Check out https://roboticsbackend.com/ros1-vs-ros2-practical-overview/#ROS1_vs_ROS2_Communication for ideas for a distributed node setup -- no need to reinvent the wheel. Also see https://ubuntu.com/robotics/what-is-ros – ubfan1 May 25 '21 at 21:49
-
I agree completely with PJ Sinh, Question is suitable for this site. – C.S.Cameron May 26 '21 at 02:57
-
A patch cable looks just like an Ethernet cable, but certain wires are "crossed" at the plug. This allows you to connect one computer directly to another, without having a router in-between. You will need to manually assign unique IP addresses to each machine. You can make your own patch cable by following on-line tutorials, if you have RJ-45 connectors, cat5/5e/6/6A cable, and a crimping tool. However, short lengths are inexpensive, so you could easily order one online or buy from a local computer store; just make sure it says "Patch Cable". – Enterprise May 26 '21 at 23:53
2 Answers
0
Right off my head, the easiest way is to use sockets, I am assuming you want the data transfer to be wireless. Sockets is a pretty easy option and you can essentially run the robot(laptop) as the server and the other laptop as a client. Here is something that might help you get started with sockets: https://www.bogotobogo.com/python/python_network_programming_server_client_file_transfer.php
0
You can probably try to script something using socat. It is a very useful tool that allows to connect various data sources and targets basically in any combination. For example you can connect input/output of some script to some TCP port on one machine, and use stdin/stdout to communicate with that port over TCP on another machine.

raj
- 10,353