Imagine walking up to a robotic arm on your lab bench—maybe a 6-DOF model from Dobot, a hobbyist arm with an Arduino Uno, or an industrial UR5—and telling an AI agent: “Pick up the red blocks and sort them into the left bin.” Within seconds, the arm moves. No dashboard, no drag-and-drop flow editor, no waiting for a developer to add a new driver. This is not a demo video; it’s what happens when you connect your robotic arm to ASI Biont, a cloud AI agent that writes its own integration code on the fly.
In this article, I’ll walk through three real ways to link a robotic arm to ASI Biont—using MQTT, ROS (via WebSocket), and a COM port (RS-232). You’ll see actual Python code that the AI writes inside its sandbox environment, understand the wiring and broker setup, and learn how to automate tasks like pick-and-place, sorting, and even teaching the arm new paths—all through natural language chat.
Why Connect a Robotic Arm to an AI Agent?
A robotic arm is only as smart as its controller. Most arms come with proprietary software (DobotStudio, URCaps, RoboDK) or require you to write scripts in C++, Python, or a vendor-specific language. Every new task means editing code, re-flashing firmware, or adjusting PLC logic. By connecting the arm to an AI agent, you gain:
- Zero-code automation: Describe a task in plain English (e.g., “When the sensor detects a part, move the arm to waypoint A and place it on conveyor B”).
- Cross-platform control: Use the same AI agent to talk to an arm today, a camera tomorrow, and a PLC next week.
- Adaptive learning: The AI can log success/failure rates of each pick and suggest optimizations (e.g., “Try a slower acceleration to reduce vibration”).
ASI Biont supports this through a universal mechanism: execute_python. You describe the device and connection parameters in the chat; the AI writes a Python script using real libraries (paho-mqtt, rospy via rosbridge, pyserial, pymodbus) and runs it in a secure sandbox. No need to wait for a new “integration module”—anything with a network or serial interface is connectable right now.
Method 1: MQTT – Best for ESP32/Arduino-Based Arms
When to use: Your arm is controlled by an ESP32, Raspberry Pi Pico W, or similar Wi-Fi-enabled microcontroller that publishes joint angles or gripper state to an MQTT broker.
Setup:
1. Install an MQTT broker (e.g., Mosquitto) on your local network or a cloud VM.
2. On the arm’s microcontroller, publish sensor data to a topic like robot/joint_states and subscribe to robot/cmd for movement commands.
3. In ASI Biont, describe the broker IP, port, and topics. The AI writes a script using paho-mqtt.
Example chat:
“Connect to my robotic arm via MQTT. Broker is at 192.168.1.50:1883, no auth. The arm publishes joint angles to
robot/jointsand accepts commands onrobot/cmdin JSON format like{"joints": [0, 90, 45, 0, 0, 0]}. Read the current position and send a command to rotate joint 2 by 30 degrees.”
The AI generates and executes:
import paho.mqtt.client as mqtt
import json
BROKER = "192.168.1.50"
PORT = 1883
TOPIC_SUB = "robot/joints"
TOPIC_PUB = "robot/cmd"
def on_message(client, userdata, msg):
data = json.loads(msg.payload.decode())
current_joints = data.get("joints", [])
print(f"Current joints: {current_joints}")
# Modify joint 2 (index 1) by +30 degrees
if len(current_joints) >= 6:
current_joints[1] += 30
cmd = json.dumps({"joints": current_joints})
client.publish(TOPIC_PUB, cmd)
print(f"Sent command: {cmd}")
client = mqtt.Client()
client.on_message = on_message
client.connect(BROKER, PORT, 60)
client.subscribe(TOPIC_SUB)
client.loop_start()
import time
time.sleep(5) # Let it run for a few seconds
client.loop_stop()
Real-world scenario: A sorting line where the arm picks components from a vibrating feeder and places them into bins. The AI monitors the arm’s current position via MQTT, and when a vision system (connected via HTTP API) sends a “part detected” message, the AI publishes the target coordinates. No manual code changes – just describe the workflow.
Method 2: ROS (Robot Operating System) via WebSocket
When to use: Your arm runs ROS (e.g., a Universal Robots UR5 with ur_robot_driver, or a custom arm using ros_control). ROS provides a rich ecosystem with rosbridge_server for WebSocket communication.
Setup:
1. Start rosbridge_server on the ROS master: roslaunch rosbridge_server rosbridge_websocket.launch.
2. Ensure the arm’s move_group or joint_state_publisher is running.
3. In ASI Biont, describe the WebSocket URI. The AI writes a script using websockets library (available in the sandbox) to send ROS commands.
Example chat:
“Connect to my ROS robotic arm via WebSocket at ws://192.168.1.100:9090. Publish a joint trajectory to the
/arm_controller/follow_joint_trajectoryaction topic. Move joint 1 to 45 degrees, joint 2 to 90 degrees, all in 2 seconds.”
The AI generates:
import asyncio
import websockets
import json
async def send_trajectory():
uri = "ws://192.168.1.100:9090"
async with websockets.connect(uri) as ws:
# Advertise the action topic (simplified)
advertise_msg = {
"op": "advertise",
"topic": "/arm_controller/follow_joint_trajectory/goal",
"type": "control_msgs/FollowJointTrajectoryActionGoal"
}
await ws.send(json.dumps(advertise_msg))
# Wait a bit, then send the goal
await asyncio.sleep(0.5)
goal = {
"op": "publish",
"topic": "/arm_controller/follow_joint_trajectory/goal",
"msg": {
"goal_id": {"stamp": {"secs": 0, "nsecs": 0}, "id": ""},
"goal": {
"trajectory": {
"joint_names": ["joint_1", "joint_2"],
"points": [
{"positions": [0.785, 1.57], "time_from_start": {"secs": 2, "nsecs": 0}}
]
}
}
}
}
await ws.send(json.dumps(goal))
print("Trajectory goal sent")
asyncio.run(send_trajectory())
(Note: In a real ROS integration, you would subscribe to feedback topics; this example shows the core pattern.)
Real-world scenario: A research lab using a Franka Emika Panda arm with ROS. The AI reads the arm’s current pose via /joint_states, then plans a collision-free path using ROS’s moveit via service calls, and executes it. The researcher only says: “Move the end effector to (0.5, 0.2, 0.3) relative to base” – the AI generates the ROS service calls.
Method 3: COM Port (RS-232 / RS-485) via Hardware Bridge
When to use: Your arm uses a serial interface – common with hobby arms (like the OSOYOO 5-DOF arm controlled by an Arduino Nano) or older industrial arms with raw ASCII command sets (e.g., T6 commands on a CRS arm).
Setup:
1. Download and run bridge.py on a PC physically connected to the arm via USB/serial. Run: python bridge.py --token=YOUR_TOKEN --ports=COM3 --default-baud=115200.
2. The bridge connects to ASI Biont via HTTP long polling. It exposes the COM port to the AI agent.
3. In the chat, simply ask the AI to send a serial command.
Example chat:
“Connect to my robotic arm on COM3 at 115200 baud. The arm accepts G-code-like commands:
G0 X100 Y50 Z30moves the tool to absolute coordinates. Send a command to move to X=50, Y=100, Z=10.”
The AI uses the industrial_command tool:
# This is a simulation of what the AI does internally
# The actual command is sent via the industrial_command tool
command = "G0 X50 Y100 Z10"
print(f"Sending to COM3: {command}")
# The bridge writes this to the serial port
In the chat, the AI would call:
industrial_command(protocol='serial://', command='G0 X50 Y100 Z10', port='COM3', baud=115200)
Real-world scenario: A maker space with a Lynxmotion AL5D arm. The AI reads the arm’s current position by polling the serial port, then calculates a smooth trajectory and sends a series of G0 commands. When a user says “draw a square of side 100 mm”, the AI computes the four corner points and sends them sequentially.
Why ASI Biont Beats Proprietary Software
Every arm vendor claims “easy programming”. In reality, you still need to install their IDE, learn their scripting language, and manually handle error states. With ASI Biont:
| Feature | Vendor Software | ASI Biont (AI Agent) |
|---|---|---|
| Setup time | 1–2 days | 5 minutes (describe in chat) |
| Language | Vendor-specific | Python (universal) |
| Multi-device | Rarely | Yes – any MQTT/Modbus/HTTP/Serial |
| Adaptability | Manual code edits | AI rewrites logic on demand |
| Error handling | Pre-coded exceptions | AI analyzes logs and suggests fixes |
Getting Started
- Go to asibiont.com and open a chat with the AI agent.
- Describe your robotic arm: manufacturer, interface (MQTT broker IP, ROS WebSocket URI, or COM port name/baud).
- Tell the AI what you want to automate: “Sort green and red blocks”, “Follow a joint path from a CSV file”, “Teach the arm by moving it manually and recording positions”.
- Watch the AI write and execute the integration code in seconds. No manual coding, no waiting for new features.
The future of robotics isn’t about learning every vendor’s language – it’s about using natural language to orchestrate any machine. ASI Biont turns your robotic arm from a fixed-purpose tool into an intelligent, adaptable partner.
Have a different arm? Connect it anyway. ASI Biont’s execute_python can talk to anything with an IP address or a serial port. Try it today.
Comments