Control multiple small robots from a single pc, how to connect

Reetus
Posts: 2
Joined: Thu Aug 17, 2023 2:36 pm

Control multiple small robots from a single pc, how to connect

Postby Reetus » Thu Aug 17, 2023 3:29 pm

Hi all,

new here and not sure if this is the correct forum to ask this so feel free to guide me to a better place if needed.

Anyway, picture attached is somewhat what I would like to build, multiple small 3D-printed robots/cars that I could control from a single pc with a controller one at a time and then change the unit I'm controlling with a D-pad on the controller or choose the unit from a software that's running on the pc. Or have multiple "players" with controllers that could shuffle the free units and each control one at a time.

I know how to write the software for the pc and I know how to write the code for the robots moving and stuff.

The question:
What is unclear to me however is how could I handle the communication between the robot unit being controlled and the pc. I guess it should be some kind of an ssh connection but not an ssh? Some form of stream of inputs from the pc to the esp. Basically rc-control but over the wifi.

The connection should be somehow terminated when a user switches from controlled unit to another so that the pc software can see that a unit is "free" to use and the robot unit itself knows to halt all motion. And then the connection should be formed again when a user decides to control that unit.

I don't think an usecase like this needs to be very secure so any kind of a raw data stream should be fine.

Most of the tutorials I find online seem to all be about making single commands to turn lights etc on/off but how would I have a constant input with joysticks and buttons. So if you know any documentation about this kind of project please leave a link.

Bonus question:
Are there some limitations which boards would be suitable for this kind of application?

Thanks in advance for any tips or help you are able to provide :)
Attachments
Screenshot 2023-08-17 180023.png
Screenshot 2023-08-17 180023.png (464.04 KiB) Viewed 1020 times

MicroController
Posts: 1708
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: Control multiple small robots from a single pc, how to connect

Postby MicroController » Fri Aug 18, 2023 3:04 pm

Probably the easiest way would be to just send UDP packets over WiFi to each robot, and potentially also from robots to the PC.
You can build arbitrarily complex protocols using just UDP packets if you like. E.g. each robot could send a "hello" packet to the PC when it is turned on/joins the WiFi, so that the PC knows the IP address of every robot. If a robot loses network or doesn't receive a UDP packet for some time it stops for safety, &c.
UDP is usually prefered over TCP for near real-time communication because TCP's congestion control and packet retransmission can cause uncontrollable delays.

Reetus
Posts: 2
Joined: Thu Aug 17, 2023 2:36 pm

Re: Control multiple small robots from a single pc, how to connect

Postby Reetus » Fri Aug 18, 2023 5:24 pm

Thanks for your suggestion, you got pretty good idea of what I was gonna do and this might have been just the what I was looking for.

You think pretty much any board would be capable for this kind of a project?

MicroController
Posts: 1708
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: Control multiple small robots from a single pc, how to connect

Postby MicroController » Sat Aug 19, 2023 12:59 pm

Reetus wrote:
Fri Aug 18, 2023 5:24 pm
You think pretty much any board would be capable for this kind of a project?
Yes. Any WiFi-capable controller would easily handle the networking, controlling a bunch of servos, and taking readings from a couple of sensors.
I recon that in addition a lot of "complex" autonomous behaviour would also fit into RAM, flash and CPU limitations.
A dual-core SoC is probably not necessary, because I believe that some (ISR) jitter of even 1ms or so wouldn't matter much in this case.

Who is online

Users browsing this forum: Baidu [Spider], Google [Bot] and 72 guests