Character Position input and output from a separate source file?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By justingodden

Hi I am new to game design.

I’m doing a project where I track a robot’s movement in real life, and would like to build some type of game engine to recreate and visualize this motion on the PC (i.e. having a robot move around a platform in a GODOT game which matches the motion of the robot in real life).

My project is written in C++ and will output an X and Y coordinate vector based on where the robot is. Is it possible to have this source code’s output be read by GODOT and used as an input to control the motion of a robot character within a game?

Also, I would like the reverse; by clicking a point on the map in GODOT for the robot to go to, this would generate an X Y coordinate to be output for another file to interact with (i.e. robot in real life can read it and know where to travel to next).

Any advice would be greatly appreciated. Thanks!

Hi, Is your robot physically connected to the computer where the game is going to be run? How is it connected?

p7f | 2018-12-11 20:21

Thank you for your reply

Not currently, no. The robot is controlled by a raspberry pi, and relays data (X Y coordinates) back to my windows laptop through WiFi.

justingodden | 2018-12-13 15:14

If you are using wifi, perhaps the best way would be transfering the information with httprequests. You could setup a server in the raspberry, and do requests to it sending desired position. In the response you could get the current position of the robot.

p7f | 2018-12-13 19:30

Hi, did you succeed in your goals with the http requests? I have the same goal as yours : making an godot application reading coordinates to recreate the motion of a robot in real life. You said that your goal what to use this on a PC, did you succeed with that? Is this adaptable to transfer this to an Android App ?

Also, do you have an idea if it is possible to handles this by other types of connections (Ethernet, Bluetooth…)? And other protocols (TCP or UDP for example)?

Thanks in advance.

Simon

simLC | 2019-04-30 14:26