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 (view all EZB hardware)
EZ-B V4 by EZ-Robot
EZ-B v4/2 robot controller: dual Cortex ARM, Wi-Fi, audio/video, 24 servo/digital ports, I2C/UART, camera and Synthiam ARC control for custom robots
Wi-Fi / USB
Servos 24
Camera
Audio
UART 3
I2C
ADC 8
Digital 24

Related Robot Skills (view all robot skills)
Custom Movement Panel maps directional commands to scripts, adjusts per-wheel speed (0-255), and integrates with joysticks for unsupported motors
Websocket Client by Synthiam
WebSocket client for ARC: open/send messages, store server responses in a variable, run a response script, and track connection status.

ARC Pro

Upgrade to ARC Pro

Your robot can be more than a simple automated machine with the power of ARC Pro!

Author Avatar
PRO
Canada
#17  

Robot just stood up  WOOT!   So happy.

Author Avatar
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}}}");
Author Avatar
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.