RC Truck and Construction  

Go Back   RC Truck and Construction > RC Truck's Ag and Industrial Equipment and Buildings > Construction Equipment

Construction Equipment If it digs, pushes, hauls dirt "off road" post it here.


 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #11  
Old 06-06-2016, 04:04 PM
SteinHDan SteinHDan is offline
Green Horn
 
Join Date: Sep 2015
Location: Oslo, Norway
Posts: 188
SteinHDan is on a distinguished road
Default Re: 90 ton 1/14 metal excavator scratch build w/embedded PC

You can try the visualization on your own PC by clicking on this link:
- http://d1t2tbzmskak12.cloudfront.net...ion/index.html




To view the client source code, just click "View source" on the web page.

The web page will try to connect to the excavator using the local IP address 192.168.0.107:8001. If it isn't able to connect, it will just play some random movements. Only computers on my network will be able to connect to my excavator, so you all will see the random movements.


On the excavator (the server in this case) I run these few lines to broadcast the positions to all clients that connect:

Code:
var ws = require("nodejs-websocket")
var server = ws.createServer().listen(8001);
setInterval(function() {
    server.connections.forEach(function (conn) {
        conn.sendText(JSON.stringify({bucket: state.bucket.pos, stick: state.stick.pos }));
    })
}, 40);
That's all there is to it!

Best regards,
Stein :-)
Reply With Quote
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:25 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.