3.1 Arm Entry Point
Overview
Arm is the unified entry point of the C++17 SDK. From the caller's perspective, it is responsible for three things:
- Managing the session lifecycle:
Connect()/Disconnect() - Filling device identification fields after connection:
version,model,robotType - Exposing business modules such as
ControllerInfo,MotionControl,ProgramManager,signals, andsub_pub
Public Fields and Service Modules
Device Identification Fields
| Field | Type | Description |
|---|---|---|
version | std::string | Controller version, filled after a successful connection |
model | std::string | Robot arm model, filled after a successful connection |
robotType | RobotType | Robot type, filled after a successful connection |
Service Modules
| Member | Purpose | Related Docs |
|---|---|---|
ControllerInfo | Basic status and control | 3.2-info |
AlarmClient | Alarm query and reset | 3.3-alarm |
ProgramManager | Program execution and poses | 3.5-program |
MotionControl | Motion and payload | 3.4-motion |
signals | IO read/write | 3.7-signals |
RegisterBank | Registers | 3.8-registers |
TrajectoryManager | Trajectories and path tables | 3.9-trajectory |
RealTimeTrajectoryControl | Real-time trajectory | 3.9-trajectory |
file_manager | File management | 3.10-file-manager |
sub_pub | WebSocket subscribe/publish | 3.13-sub-pub |
JoggingControl | Jogging | 3.11-jogging |
ExtensionClient | Plugin services | 3.12-extension |
CoordinateSystemManager | Coordinate system management | 3.15-coordinate-system |
ModbusClient | Modbus | 3.14-modbus |
3.1.1 Constructor
cpp
Arm()| Item | Description |
|---|---|
| Description | Creates a robot session object. No manual configuration loading is required; the class checks the SDK version and identifies the controller type during connection |
| Request Parameters | None |
| Return Value | Constructed object |
| Compatible Robot Software Versions | Collaborative (Copper): v7.5.0.0+ Industrial (Bronze): v7.5.0.0+ |
3.1.2 Connect to the Robot
cpp
Connect(const std::string& controllerIp, const std::string& teachPanelIp = "") -> STATUS_CODE| Item | Description |
|---|---|
| Description | Connects to an Agilebot robot. This method starts the dedicated Arm network thread, binds service modules, and fills version , model , and robotType after connection |
| Request Parameters | controllerIp : std::string , controller IP address.teachPanelIp : std::string , teach pendant IP address. Optional, but recommended for industrial robots |
| Return Value | STATUS_CODE: function execution result |
| Notes | - If controllerIp or teachPanelIp is not a valid IP address, INVALID_IP_ADDRESS is returned.- If the controller cannot be connected, OTHER_ERR is returned with error information |
| Compatible Robot Software Versions | Collaborative (Copper): v7.5.0.0+ Industrial (Bronze): v7.5.0.0+ |
Available Immediately After a Successful Connection
After connection succeeds:
version,model, androbotTypeare filled.ControllerInfo,AlarmClient,ProgramManager,MotionControl,signals,RegisterBank,TrajectoryManager,file_manager,JoggingControl,ExtensionClient,CoordinateSystemManager, andModbusClientcan be called directly.sub_pubrecords the default target address, soarm.sub_pub.Connect()can be called later without passing it again.
3.1.3 Check Whether the Robot Connection Is Valid
cpp
IsConnected() const -> bool| Item | Description |
|---|---|
| Description | Checks whether the connection to the robot is valid |
| Request Parameters | None |
| Return Value | bool: connection state. True means connected, False means disconnected |
| Compatible Robot Software Versions | Collaborative (Copper): v7.5.0.0+ Industrial (Bronze): v7.5.0.0+ |
3.1.4 Check Whether the SDK Has Finished Initialization
cpp
IsInitialized() const -> bool| Item | Description |
|---|---|
| Description | Checks whether the local network thread object has been created. For a normally constructed Arm , this is usually always true |
| Request Parameters | None |
| Return Value | bool: True means initialization is complete and Connect() can be attempted; False means initialization failed |
| Compatible Robot Software Versions | Collaborative (Copper): v7.5.0.0+ Industrial (Bronze): v7.5.0.0+ |
3.1.5 Disconnect from the Robot
cpp
Disconnect()| Item | Description |
|---|---|
| Description | Disconnects from the Agilebot robot, clears binding state for all service modules, and stops the dedicated network thread |
| Request Parameters | None |
| Return Value | No return value |
| Behavior | - Actively disconnects sub_pub - Cleans up JoggingControl and ExtensionClient - Clears controllerIp , teachPanelIp , version , and model - Resets robotType to UNKNOWN |
| Compatible Robot Software Versions | Collaborative (Copper): v7.5.0.0+ Industrial (Bronze): v7.5.0.0+ |
When to Call It Manually
- Call it when normal business logic ends.
- Call it before switching devices after an error.
- Although destruction calls it as a fallback, do not rely entirely on destructor cleanup.
3.1.6 Address Normalization Behavior
Connect() keeps compatibility completion rules for a few known default topologies. If the application already knows both addresses, pass them explicitly instead of relying on implicit completion.
| Input | Result |
|---|---|
controllerIp = "192.168.110.2" , teachPanelIp = "" | Automatically fills teachPanelIp as 192.168.110.102 |
controllerIp = "192.168.110.102" , teachPanelIp = "" | Automatically corrects controllerIp to 192.168.110.2 and sets teachPanelIp to 192.168.110.102 |
controllerIp is set and teachPanelIp = "" | For collaborative robots, the SDK normalizes the empty teachPanelIp to controllerIp |
Both controllerIp and teachPanelIp are passed explicitly | Uses the user's explicit input values |
3.1.7 Connection Limits and Behavior
Connect()is the prerequisite for all service modules.- If the current session is already connected to the same
controllerIp + teachPanelIpcombination, it returnsOKdirectly. - If the current session is connected to another device,
Connect()automatically callsDisconnect()first, then switches to the new device. - If version query fails during connection, connection state is rolled back automatically.
3.1.8 Thread Model from the Caller Perspective
- Here, "synchronous" means the caller waits for the request result after making a call. It does not mean the SDK creates another synchronous thread for application logic.
- One
Armsession corresponds to one dedicated network thread; most network requests on the sameArmexecute serially. - The periodic tasks used by
Info::AcquireAccess()andJogging::ContinuousMove()/MultiMove()reuse this network thread and do not expose independent application threads. - Callbacks from
SubPub::StartReceiving()run on an independent WebSocket receive thread. Keep callback logic lightweight. - For the full concurrency constraints, see
1.3-thread-model.
Minimal Call Example
Example code:
cpp
#include "connect_disconnect/run.h"
int main(void)
{
// [ZH] 默认只调用一个门面方法;如需体验其他接口,请把下一行替换成下面任意一行。
// [EN] The main function calls only one facade by default. Replace the next line with any line below to try other APIs.
return RunArmConnectDisconnectLifecycle();
}cpp
#include "reconnect_once/run.h"
int main(void)
{
// [ZH] 默认只调用一个门面方法;如需体验其他接口,请把下一行替换成下面任意一行。
// [EN] The main function calls only one facade by default. Replace the next line with any line below to try other APIs.
return RunArmReconnectOnce();
}cpp
#include "multi_instance_isolation/run.h"
#include "subscribe_topics/run.h"
#include "send_receive_text/run.h"
int main(void)
{
// [ZH] 默认只调用一个门面方法;如需体验其他接口,请把下一行替换成下面任意一行。
// [EN] The main function calls only one facade by default. Replace the next line with any line below to try other APIs.
return RunSubPubBasicSubscribeTopics();
// return RunSubPubBasicSendReceiveText();
// return RunSubPubBasicMultiInstanceIsolation();
}cpp
#include "query_state_modes/run.h"
#include "write_back_modes/run.h"
#include "access_control/run.h"
#include "action_apis/run.h"
int main(void)
{
// [ZH] 默认只调用一个门面方法;如需体验其他接口,请把下一行替换成下面任意一行。
// [EN] The main function calls only one facade by default. Replace the next line with any line below to try other APIs.
return RunInfoStateModesQueryStateModes();
// return RunInfoStateModesWriteBackModes();
// return RunInfoStateModesAccessControl();
// return RunInfoStateModesActionApis();
}