Skip to content

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:

  1. Managing the session lifecycle: Connect() / Disconnect()
  2. Filling device identification fields after connection: version , model , robotType
  3. Exposing business modules such as ControllerInfo , MotionControl , ProgramManager , signals , and sub_pub

Public Fields and Service Modules

Device Identification Fields

FieldTypeDescription
versionstd::stringController version, filled after a successful connection
modelstd::stringRobot arm model, filled after a successful connection
robotTypeRobotTypeRobot type, filled after a successful connection

Service Modules

MemberPurposeRelated Docs
ControllerInfoBasic status and control3.2-info
AlarmClientAlarm query and reset3.3-alarm
ProgramManagerProgram execution and poses3.5-program
MotionControlMotion and payload3.4-motion
signalsIO read/write3.7-signals
RegisterBankRegisters3.8-registers
TrajectoryManagerTrajectories and path tables3.9-trajectory
RealTimeTrajectoryControlReal-time trajectory3.9-trajectory
file_managerFile management3.10-file-manager
sub_pubWebSocket subscribe/publish3.13-sub-pub
JoggingControlJogging3.11-jogging
ExtensionClientPlugin services3.12-extension
CoordinateSystemManagerCoordinate system management3.15-coordinate-system
ModbusClientModbus3.14-modbus

3.1.1 Constructor

cpp
Arm()
ItemDescription
DescriptionCreates a robot session object. No manual configuration loading is required; the class checks the SDK version and identifies the controller type during connection
Request ParametersNone
Return ValueConstructed object
Compatible Robot Software VersionsCollaborative (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
ItemDescription
DescriptionConnects to an Agilebot robot. This method starts the dedicated Arm network thread, binds service modules, and fills version , model , and robotType after connection
Request ParameterscontrollerIp : std::string , controller IP address.
teachPanelIp : std::string , teach pendant IP address. Optional, but recommended for industrial robots
Return ValueSTATUS_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 VersionsCollaborative (Copper): v7.5.0.0+
Industrial (Bronze): v7.5.0.0+

Available Immediately After a Successful Connection

After connection succeeds:

  1. version , model , and robotType are filled.
  2. ControllerInfo , AlarmClient , ProgramManager , MotionControl , signals , RegisterBank , TrajectoryManager , file_manager , JoggingControl , ExtensionClient , CoordinateSystemManager , and ModbusClient can be called directly.
  3. sub_pub records the default target address, so arm.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
ItemDescription
DescriptionChecks whether the connection to the robot is valid
Request ParametersNone
Return Valuebool: connection state. True means connected, False means disconnected
Compatible Robot Software VersionsCollaborative (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
ItemDescription
DescriptionChecks whether the local network thread object has been created. For a normally constructed Arm , this is usually always true
Request ParametersNone
Return Valuebool: True means initialization is complete and Connect() can be attempted; False means initialization failed
Compatible Robot Software VersionsCollaborative (Copper): v7.5.0.0+
Industrial (Bronze): v7.5.0.0+

3.1.5 Disconnect from the Robot

cpp
Disconnect()
ItemDescription
DescriptionDisconnects from the Agilebot robot, clears binding state for all service modules, and stops the dedicated network thread
Request ParametersNone
Return ValueNo 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 VersionsCollaborative (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.

InputResult
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 explicitlyUses 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 + teachPanelIp combination, it returns OK directly.
  • If the current session is connected to another device, Connect() automatically calls Disconnect() 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 Arm session corresponds to one dedicated network thread; most network requests on the same Arm execute serially.
  • The periodic tasks used by Info::AcquireAccess() and Jogging::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:

cpp17/arm_connect_disconnect/src/main.cpp
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();
}
cpp17/arm_reconnect/src/main.cpp
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();
}
cpp17/sub_pub_basic/src/main.cpp
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();
}
cpp17/info_state_modes/src/main.cpp
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();
}