Canada
Asked
Resolved Resolved by DJ Sures!

JSON To Mjbots Quad Robot Series

My robot wants to communicate via JSON commands (it is controlled via JSON from a browser) but I need to use ARC to talk to it. It also sends a lot of data back over JSON to provide current servo status that would need to be fed back into ARC.  Any thoughts if this can be adapted to communicate with the robot? https://github.com/mjbots/quad/blob/main/mech/web_control_assets/index.html


Related Hardware EZ-B v4

ARC Pro

Upgrade to ARC Pro

Stay on the cutting edge of robotics with ARC Pro, guaranteeing that your robot is always ahead of the game.

PRO
Canada
#17  

Robot just stood up  WOOT!   So happy.

PRO
Synthiam
#18   — Edited

Noice!!!!

Once you figure out the movement commands and speed, then you can use the Custom Movement Panel to rock it

Something like this for Forward. I dunno if that's the correct json or not. But the idea is use the Map function to convert the ARC speed (0-255) into a float of (0-1) for that robot.



var s = Utility.map(
  Movement.getSpeed(),
  0,
  255,
  0,
  0.5);
  
ControlCommand("WebSocket Client", "Send", "{\"command\":{\"mode\":\"walk\",\"log\":\"disable\",\"v_R\":[" + s + ",0,0],\"w_R\":[0,0,0],\"walk\":{\"step_height\":1,\"maximize_flight\":false}}}");

PRO
Canada
#19   — Edited

Thanks for all your help on this DJ.  I have it obeying a bunch of commands.  Still a while to go but he can stand laydown and we are learning to walk.  Lots of fun.