Controlling Virtual Object and Physical Object using BabylonJS and Arduino

Hi everyone,

I want to demonstrate my simple work using BabylonJS. Here, I use Arduino to move the robot arm as a physical object and BabylonJS to visualize the robot arm in the real world (although the physical and virtual models are not the same haha). I can control the movements of the virtual robot arm using input from the potentiometer on Arduino. On the other hand, I can also grind the physical robot arm using input from the slider in the scene.

15 Likes

This is so cooooooool !!! @PirateJC

1 Like

Thank you !!!

1 Like

Oh man this is INCREDIBLE! I’m obsessed with IOT applications like this! Amazing!

Do you mind if I put this on the list of projects to be considered to be featured in our next release video?

2 Likes

Sure, that would be great… Thank you :smile: :smile:

1 Like

Whoaaa innovative :smiley:

1 Like

I’m new to babylonjs and 3d modeling in general but I’m try to accomplish something similar. I’m having trouble linking the joints and was wondering what the best approach is for this.

1 Like

Hi Darren,

I am using a 3D model that has several connected submeshes. In the code, I declare a new variable for each submesh of the 3D model to control each joint in my robot arm model. The code will look like this:

BABYLON.SceneLoader.ImportMesh("", "assets/arm-robot/", "arm-robot.babylon", scene, function (newMeshes) {
     var base = newMeshes[0];
     var mesh1= newMeshes[1];
     var mesh2 = newMeshes[2];
     var mesh3 = newMeshes[3];
     var mesh4 = newMeshes[4];}

This is the submeshes of my 3D model :
Screenshot_184

Is it possible to have the source code for the animation of the robot arm on babylonJS please ?
I started learning BabylonJs recently, and i didn’t find any tutorial about animating a robot arm with babylonJs+React.

Thank you.

Hi,

Here is the source code url: GitHub - ilhamachmada/robot-arm-babylonjs-webxr: Controlling Physical and Virtual Robot Arm using Babylonjs and Arduino for WebXR

Feel free to use :slight_smile:

Thank you so much for your help. :grin:

hey is this code up somewhere, I’m now wondering about controlling the arm in VR with the controller being the arduino, oh lol I just saw the source code

it says for WebXR, so you already have this going in VR, is it hosted somewhere, so I can log in and look at it?