4.12 로봇 조깅 모션
개요
Jogging 클래스는 단일 축 스테핑, 단일 축 연속 조그, 다축 연속 조그 및 정지 작업을 포함하여 수동 교육 모드에서 조그 제어 API를 제공합니다.
핵심 기능
- 단축 스텝 조깅
- 단축 연속 조깅
- 다축 연속 조깅
- 지속적인 조깅을 중지
- 포지티브/negative 축 기호를 사용한 방향 제어
- 구성 가능한 선형 스텝 길이 및 회전 스텝 각도
사용 사례
- 로봇 디버깅 및 교육 과정
- 미세 위치 및 자세 조정
- 호스트 측 원격 수동 자세 조정
- 로봇 설치 및 교정
- 복잡한 궤적을 실행하기 전 Position 확인
4.12.1 단일축 스텝 조깅
| 메서드 이름 | Jogging.Move(int ajNum , MoveMode moveMode , double stepLength = 0, double stepAngle = 0) |
|---|---|
| 설명 | 단일축 스텝 조깅( moveMode = MoveMode.Stepping )을 실행합니다. |
| 요청 매개변수 | ajNum : int 축 인덱스(1~6은 현재 좌표계 축에 매핑됩니다. 데카르트 모드에서는 x/y/z/rx/ry/rz가 1~6에 매핑됩니다. 부호는 방향을 나타냅니다.) moveMode : 이 시나리오에서는 이동 모드가 MoveMode.Stepping 로 고정되었습니다. stepLength : double 선형 스텝 길이(mm)(스테핑 모드에서 유효). stepAngle : 이중 회전 스텝 각도(°)(스테핑 모드에서 유효). |
| 반환 값 | StatusCode: 조그 동작 결과 |
| 호환 로봇 소프트웨어 버전 | 협업(Copper): v7.5.0.0+ 산업용(Bronze): v7.5.0.0+ |
예제 코드
cs
using Agilebot.IR;
using Agilebot.IR.Types;
public class StepJogging
{
public static StatusCode Run(string controllerIP, bool useLocalProxy = true)
{
// [ZH] 初始化捷勃特机器人
// [EN] Initialize the Agilebot robot
Arm controller = new Arm(controllerIP, useLocalProxy);
// [ZH] 连接捷勃特机器人
// [EN] Connect to the Agilebot robot
StatusCode code = controller.ConnectSync();
Console.WriteLine(code != StatusCode.OK ? code.GetDescription() : "连接成功/Successfully connected.");
if (code != StatusCode.OK)
{
return code;
}
try
{
// [ZH] 获取机器人模式
// [EN] Get robot mode
(UserOpMode opMode, StatusCode opCode) = controller.GetOpMode();
if (opCode == StatusCode.OK)
{
Console.WriteLine($"当前机器人模式/Current robot mode: {opMode}");
if (opMode != UserOpMode.UNLIMITED_MANUAL && opMode != UserOpMode.LIMIT_MANUAL)
{
Console.WriteLine($"示教运动必须在机器人手动模式下/Jogging must be in manual mode");
return StatusCode.OtherReason;
}
}
else
{
Console.WriteLine($"获取机器人模式失败/Failed to get robot mode: {opCode.GetDescription()}");
}
// [ZH] 设置单步示教运动参数
// [EN] Set step jogging parameters
int ajNum = 1; // 轴序号,正数表示正方向运动
MoveMode moveMode = MoveMode.Stepping; // 单步运动模式
double stepLength = 5.0; // 步长,单位为mm或角度
double stepAngle = 5.0; // 轴旋转角度,单位为角度
Console.WriteLine("开始单步示教运动/Starting Step Jogging");
Console.WriteLine($"轴序号/Axis Number: {ajNum}");
Console.WriteLine($"运动模式/Move Mode: {moveMode}");
Console.WriteLine($"步长/Step Length: {stepLength}");
// [ZH] 执行单步示教运动
// [EN] Execute step jogging movement
code = controller.Jogging.Move(ajNum, moveMode, stepLength, stepAngle);
if (code == StatusCode.OK)
{
Console.WriteLine("单步示教运动执行成功/Step Jogging Executed Successfully");
Console.WriteLine(
$"轴{ajNum}向正方向移动{stepLength}单位/Axis {ajNum} moved {stepLength} units in positive direction"
);
}
else
{
Console.WriteLine($"单步示教运动执行失败/Step Jogging Execution Failed: {code.GetDescription()}");
}
// [ZH] 等待一秒后执行反向运动
// [EN] Wait one second then execute reverse movement
Thread.Sleep(1000);
// [ZH] 执行反向单步运动
// [EN] Execute reverse step movement
int reverseAjNum = -ajNum; // 负数表示负方向运动
code = controller.Jogging.Move(reverseAjNum, moveMode, stepLength, stepAngle);
if (code == StatusCode.OK)
{
Console.WriteLine("反向单步示教运动执行成功/Reverse Step Jogging Executed Successfully");
Console.WriteLine(
$"轴{Math.Abs(reverseAjNum)}向负方向移动{stepLength}单位/Axis {Math.Abs(reverseAjNum)} moved {stepLength} units in negative direction"
);
}
else
{
Console.WriteLine(
$"反向单步示教运动执行失败/Reverse Step Jogging Execution Failed: {code.GetDescription()}"
);
}
}
catch (Exception ex)
{
Console.WriteLine($"执行过程中发生异常/Exception occurred during execution: {ex.Message}");
code = StatusCode.OtherReason;
}
finally
{
// [ZH] 关闭连接
// [EN] Close the connection
StatusCode disconnectCode = controller.Disconnect();
if (disconnectCode != StatusCode.OK)
{
Console.WriteLine(disconnectCode.GetDescription());
if (code == StatusCode.OK)
code = disconnectCode;
}
}
return code;
}
}4.12.2 단일축 연속 조깅
| 메서드 이름 | Jogging.Move(int ajNum , MoveMode moveMode , double stepLength = 0, double stepAngle = 0) |
|---|---|
| 설명 | 단축 연속 조깅( moveMode = MoveMode.Continuous )을 실행합니다. |
| 요청 매개변수 | ajNum : int 축 인덱스(1~6은 현재 좌표계 축에 매핑됩니다. 데카르트 모드에서는 x/y/z/rx/ry/rz가 1~6에 매핑됩니다. 부호는 방향을 나타냅니다.) moveMode : 이 시나리오에서는 이동 모드가 MoveMode.Continuous 로 고정되었습니다. stepLength : 이중 단계 매개변수(일반적으로 연속 모드에서는 사용되지 않음). stepAngle : 이중 단계 각도 매개변수(일반적으로 연속 모드에서는 사용되지 않음). |
| 반환 값 | StatusCode: 조그 동작 결과 |
| 호환 로봇 소프트웨어 버전 | 협업(Copper): v7.5.0.0+ 산업용(Bronze): v7.5.0.0+ |
예제 코드
cs
using Agilebot.IR;
using Agilebot.IR.Types;
public class ContinuousJogging
{
public static StatusCode Run(string controllerIP, bool useLocalProxy = true)
{
// [ZH] 初始化捷勃特机器人
// [EN] Initialize the Agilebot robot
Arm controller = new Arm(controllerIP, useLocalProxy);
// [ZH] 连接捷勃特机器人
// [EN] Connect to the Agilebot robot
StatusCode code = controller.ConnectSync();
Console.WriteLine(code != StatusCode.OK ? code.GetDescription() : "连接成功/Successfully connected.");
if (code != StatusCode.OK)
{
return code;
}
try
{
// [ZH] 获取机器人模式
// [EN] Get robot mode
(UserOpMode opMode, StatusCode opCode) = controller.GetOpMode();
if (opCode == StatusCode.OK)
{
Console.WriteLine($"当前机器人模式/Current robot mode: {opMode}");
if (opMode != UserOpMode.UNLIMITED_MANUAL && opMode != UserOpMode.LIMIT_MANUAL)
{
Console.WriteLine($"示教运动必须在机器人手动模式下/Jogging must be in manual mode");
return StatusCode.OtherReason;
}
}
else
{
Console.WriteLine($"获取机器人模式失败/Failed to get robot mode: {opCode.GetDescription()}");
}
// [ZH] 设置示教运动参数
// [EN] Set jogging parameters
int ajNum = 3; // 轴序号,正数表示正方向运动
MoveMode moveMode = MoveMode.Continuous; // 连续运动模式
Console.WriteLine("开始连续示教运动/Starting Continuous Jogging");
Console.WriteLine($"轴序号/Axis Number: {ajNum}");
Console.WriteLine($"运动模式/Move Mode: {moveMode}");
// [ZH] 启动连续示教运动
// [EN] Start continuous jogging movement
code = controller.Jogging.Move(ajNum, moveMode);
if (code == StatusCode.OK)
{
Console.WriteLine("连续示教运动启动成功/Continuous Jogging Started Successfully");
Console.WriteLine("运动3秒后自动停止/Moving for 3 seconds then auto stop");
// [ZH] 运动3秒
// [EN] Move for 3 seconds
Thread.Sleep(3000);
// [ZH] 停止示教运动
// [EN] Stop jogging movement
controller.Jogging.Stop();
Console.WriteLine("示教运动已停止/Jogging Movement Stopped");
}
else
{
Console.WriteLine($"连续示教运动启动失败/Continuous Jogging Start Failed: {code.GetDescription()}");
}
}
catch (Exception ex)
{
Console.WriteLine($"执行过程中发生异常/Exception occurred during execution: {ex.Message}");
code = StatusCode.OtherReason;
}
finally
{
// [ZH] 关闭连接
// [EN] Close the connection
StatusCode disconnectCode = controller.Disconnect();
if (disconnectCode != StatusCode.OK)
{
Console.WriteLine(disconnectCode.GetDescription());
if (code == StatusCode.OK)
code = disconnectCode;
}
}
return code;
}
}4.12.3 다축 연속 조깅
| 메서드 이름 | Jogging.MultiMove(int[] ajNums ) |
|---|---|
| 설명 | 여러 축에서 동시에 연속 조깅을 실행합니다. |
| 요청 매개변수 | ajNums : int[] 축 목록(1~6은 현재 좌표계 축에 매핑됩니다. 데카르트 모드에서는 x/y/z/rx/ry/rz가 1~6에 매핑됩니다. 기호는 각 축 방향을 나타냅니다.) |
| 반환 값 | StatusCode: 조그 동작 결과 |
| 호환 로봇 소프트웨어 버전 | 협업(Copper): v7.5.0.0+ 산업용(Bronze): v7.5.0.0+ |
예제 코드
cs
using Agilebot.IR;
using Agilebot.IR.Jogging;
using Agilebot.IR.Types;
public class MultiJogging
{
public static StatusCode Run(string controllerIP, bool useLocalProxy = true)
{
// [ZH] 初始化捷勃特机器人
// [EN] Initialize the Agilebot robot
Arm controller = new Arm(controllerIP, useLocalProxy);
// [ZH] 连接捷勃特机器人
// [EN] Connect to the Agilebot robot
StatusCode code = controller.ConnectSync();
Console.WriteLine(code != StatusCode.OK ? code.GetDescription() : "连接成功/Successfully connected.");
if (code != StatusCode.OK)
{
return code;
}
try
{
// [ZH] 获取机器人模式
// [EN] Get robot mode
(UserOpMode opMode, StatusCode opCode) = controller.GetOpMode();
if (opCode == StatusCode.OK)
{
Console.WriteLine($"当前机器人模式/Current robot mode: {opMode}");
if (opMode != UserOpMode.UNLIMITED_MANUAL && opMode != UserOpMode.LIMIT_MANUAL)
{
Console.WriteLine($"示教运动必须在机器人手动模式下/Jogging must be in manual mode");
return StatusCode.OtherReason;
}
}
else
{
Console.WriteLine($"获取机器人模式失败/Failed to get robot mode: {opCode.GetDescription()}");
}
Console.WriteLine("开始多轴示教运动/Starting Multi-axis Jogging");
Console.WriteLine("演示多轴运动/Demo multi-axis step movements");
// [ZH] 多轴运动
// [EN] Multi-axis step movement
Console.WriteLine("\n=== 多轴运动/Multi-axis Step Movement ===");
int[] axes = { 1, 2, 3 }; // 正方向运动
code = controller.Jogging.MultiMove(axes);
if (code == StatusCode.OK)
{
Console.WriteLine("连续示教运动启动成功/Continuous Jogging Started Successfully");
Console.WriteLine("运动3秒后自动停止/Moving for 3 seconds then auto stop");
// [ZH] 运动3秒
// [EN] Move for 3 seconds
Thread.Sleep(3000);
// [ZH] 停止示教运动
// [EN] Stop jogging movement
controller.Jogging.Stop();
Console.WriteLine("示教运动已停止/Jogging Movement Stopped");
}
else
{
Console.WriteLine($"连续示教运动启动失败/Continuous Jogging Start Failed: {code.GetDescription()}");
}
Console.WriteLine("\n多轴示教运动完成/Multi-axis Jogging Completed");
}
catch (Exception ex)
{
Console.WriteLine($"执行过程中发生异常/Exception occurred during execution: {ex.Message}");
code = StatusCode.OtherReason;
}
finally
{
// [ZH] 关闭连接
// [EN] Close the connection
StatusCode disconnectCode = controller.Disconnect();
if (disconnectCode != StatusCode.OK)
{
Console.WriteLine(disconnectCode.GetDescription());
if (code == StatusCode.OK)
code = disconnectCode;
}
}
return code;
}
}4.12.4 지속적인 조깅 중지
| 메서드 이름 | Jogging.Stop() |
|---|---|
| 설명 | 현재 연속적인 조그 이동을 중지합니다. |
| 요청 매개변수 | 없음 |
| 반환 값 | 무효의 |
| 메모 | 이 방법은 연속 조깅 모드에서만 필요합니다. |
| 호환 로봇 소프트웨어 버전 | 협업(Copper): v7.5.0.0+ 산업용(Bronze): v7.5.0.0+ |
예제 코드
cs
using Agilebot.IR;
using Agilebot.IR.Types;
public class ContinuousJogging
{
public static StatusCode Run(string controllerIP, bool useLocalProxy = true)
{
// [ZH] 初始化捷勃特机器人
// [EN] Initialize the Agilebot robot
Arm controller = new Arm(controllerIP, useLocalProxy);
// [ZH] 连接捷勃特机器人
// [EN] Connect to the Agilebot robot
StatusCode code = controller.ConnectSync();
Console.WriteLine(code != StatusCode.OK ? code.GetDescription() : "连接成功/Successfully connected.");
if (code != StatusCode.OK)
{
return code;
}
try
{
// [ZH] 获取机器人模式
// [EN] Get robot mode
(UserOpMode opMode, StatusCode opCode) = controller.GetOpMode();
if (opCode == StatusCode.OK)
{
Console.WriteLine($"当前机器人模式/Current robot mode: {opMode}");
if (opMode != UserOpMode.UNLIMITED_MANUAL && opMode != UserOpMode.LIMIT_MANUAL)
{
Console.WriteLine($"示教运动必须在机器人手动模式下/Jogging must be in manual mode");
return StatusCode.OtherReason;
}
}
else
{
Console.WriteLine($"获取机器人模式失败/Failed to get robot mode: {opCode.GetDescription()}");
}
// [ZH] 设置示教运动参数
// [EN] Set jogging parameters
int ajNum = 3; // 轴序号,正数表示正方向运动
MoveMode moveMode = MoveMode.Continuous; // 连续运动模式
Console.WriteLine("开始连续示教运动/Starting Continuous Jogging");
Console.WriteLine($"轴序号/Axis Number: {ajNum}");
Console.WriteLine($"运动模式/Move Mode: {moveMode}");
// [ZH] 启动连续示教运动
// [EN] Start continuous jogging movement
code = controller.Jogging.Move(ajNum, moveMode);
if (code == StatusCode.OK)
{
Console.WriteLine("连续示教运动启动成功/Continuous Jogging Started Successfully");
Console.WriteLine("运动3秒后自动停止/Moving for 3 seconds then auto stop");
// [ZH] 运动3秒
// [EN] Move for 3 seconds
Thread.Sleep(3000);
// [ZH] 停止示教运动
// [EN] Stop jogging movement
controller.Jogging.Stop();
Console.WriteLine("示教运动已停止/Jogging Movement Stopped");
}
else
{
Console.WriteLine($"连续示教运动启动失败/Continuous Jogging Start Failed: {code.GetDescription()}");
}
}
catch (Exception ex)
{
Console.WriteLine($"执行过程中发生异常/Exception occurred during execution: {ex.Message}");
code = StatusCode.OtherReason;
}
finally
{
// [ZH] 关闭连接
// [EN] Close the connection
StatusCode disconnectCode = controller.Disconnect();
if (disconnectCode != StatusCode.OK)
{
Console.WriteLine(disconnectCode.GetDescription());
if (code == StatusCode.OK)
code = disconnectCode;
}
}
return code;
}
}