I have an instrumentation setup where multiple inertial sensors (IMU’s ) sends orientation information to the PC at 50Hz. I wanted to develop a game which takes these input from inertial sensors and uses as a control parameter of the game. I am not sure how to do this on Panda (and I am new to game development) and any help in this regard would make the process easier and I would like to know your opinion in this regard.
I am sending the data from microcontroller using a bluetooth module (Bluegiga WT12 module). As of now, I was using pyserial to read the data and VPython for simple animation purposes. Can you explain a bit more how it could be implemented either Panda3D or pygame.
A simple game like Ping Pong with some adaptive nature would be enough for me as of now.
Sounds like you can use your existing pyserial code. Here is how I would do it.
Create and run a panda task function (the function will run once every panda frame) that reads a non-blocking pyserial connection. You might need to use a string variable as a buffer for incomplete data.
After the port is read, process your input data into how you want panda3d to react to it. Sounds like you also already have some of this done with your vpython code. I would then communicate the instructions using panda’s event system. You will then have nodepaths (such as pong paddles) listen for the event. You can also package additional data with the event, such as how fast to move a pong paddle for example.
@Croxis, What I have done with vpython is a cube animation using the serial data from the inertial sensors. I have started watching the video tutorials and I am not getting it easily. I am new to this gaming platform and it would be great if you can provide some sample code for the same.