Appearance
aubo_control 日志分析
aubo_control日志存放路径: /root/arcs_ws/log/
1.日志结构分析
以上图为例
日志等级
TRACE_L3: 表示最详细的日志级别,通常用于调试目的。
TRACE_L2: 表示次详细的日志级别,通常用于调试目的。
TRACE_L1: 表示最少的日志级别,通常用于调试目的。
DEBUG: 表示调试信息级别,用于输出程序运行时的调试信息。
INFO: 表示信息级别,用于输出程序运行时的一般信息。
WARNING: 表示警告级别,用于输出程序运行时的警告信息。
ERROR: 表示错误级别,用于输出程序运行时的错误信息。日志类别
rob1: 机器人
legacy_robot1:硬件抽象层
RuntimeMachine:运行状态
aubo_script:脚本
aubo_comm:rpc服务端
core:核心
SimHW:仿真
rob1::alg:算法层
2.版本号获取
关键字 aubo_control version
如下图所示,0.26.0-alpha.7+9fa6e19
就是版本号
3.安全状态
关键字 SafetyModeType
SafetyModeType.Undefined // 安全状态待定
SafetyModeType.Normal // 正常运行模式
SafetyModeType.ReducedMode // 缩减运行模式
SafetyModeType.Recovery // 启动时如果在安全限制之外, 机器人将进入恢复模式
SafetyModeType.Violation // 超出安全限制(根据安全配置, 例如速度超限等)
SafetyModeType.ProtectiveStop // 软件触发的停机(保持轨迹, 不抱闸, 不断电)
SafetyModeType.SafeguardStop // IO触发的防护停机(不保持轨迹, 抱闸, 不断电)
SafetyModeType.SystemEmergencyStop // 系统急停:急停信号由外部输入(可配置输入), 不对外输出急停信号
SafetyModeType.RobotEmergencyStop // 机器人急停:控制柜急停输入或者示教器急停按键触发, 对外输出急停信号
SafetyModeType.Fault // 机械臂硬件故障或者系统故障
eg.
06/02/23 09:11:34.024340 [20425] INFO rob1:alarm - C30039: Safety mode changed: SafetyModeType.Normal
06/02/23 11:25:19.127938 [20425] INFO rob1:alarm - C30039: Safety mode changed: SafetyModeType.Undefined
4.机器人状态
关键字 RobotModeType
RobotModeType.Disconnected // 没有连接到机械臂本体(机械臂本体航插线断开)
RobotModeType.ConfirmSafety // 正在进行安全配置, 断电状态下进行
RobotModeType.Booting // 机械臂本体正在上电初始化
RobotModeType.PowerOff // 机械臂本体处于断电状态
RobotModeType.PowerOn // 机械臂本体上电成功, 刹车暂未松开(抱死), 关节初始状态未获取
RobotModeType.Idle // 机械臂上电成功, 刹车暂未松开(抱死), 电机不通电, 关节初始状态获取完成
RobotModeType.BrakeReleasing // 机械臂上电成功, 刹车正在松开
RobotModeType.BackDrive // 反向驱动:刹车松开, 电机不通电
RobotModeType.Running // 机械臂刹车松开, 运行模式, 控制权由硬件移交给软件
RobotModeType.Maintaince // 维护模式: 包括固件升级、参数写入等
eg.
05/31/23 20:40:29.878073 [64825] INFO rob1:alarm - C30045: Robot mode changed: RobotModeType.PowerOff
05/31/23 20:40:40.092940 [64825] INFO rob1:alarm - C30045: Robot mode changed: RobotModeType.ConfirmSafety
05/31/23 20:40:40.153198 [64825] INFO rob1:alarm - C30045: Robot mode changed: RobotModeType.Booting
05/31/23 20:40:41.155260 [64825] INFO rob1:alarm - C30045: Robot mode changed: RobotModeType.PowerOn
05/31/23 20:40:42.152681 [64825] INFO rob1:alarm - C30045: Robot mode changed: RobotModeType.Idle
05/31/23 20:40:52.433359 [64825] INFO rob1:alarm - C30045: Robot mode changed: RobotModeType.BrakeReleasing
05/31/23 20:40:53.433309 [64825] INFO rob1:alarm - C30045: Robot mode changed: RobotModeType.Running
5.运行时状态切换
关键字 Runtime machine mode
RuntimeState.Running // 正在运行中
RuntimeState.Retracting // 倒退
RuntimeState.Pausing // 暂停中
RuntimeState.Paused // 暂停状态
RuntimeState.Stepping // 单步执行中
RuntimeState.Stopping // 受控停止中(保持原有轨迹)
RuntimeState.Stopped // 已停止
RuntimeState.Aborting // 停止(最大速度关节运动停机)
eg.
06/01/23 19:29:27.986594 [1387] INFO RuntimeMachine - Runtime machine mode changed from RuntimeState.Stopped to RuntimeState.Running
06/01/23 19:29:28.151599 [1387] INFO RuntimeMachine - Runtime machine mode changed from RuntimeState.Running to RuntimeState.Stopping
06/01/23 19:38:00.422546 [1378] INFO RuntimeMachine - Runtime machine mode changed from RuntimeState.Running to RuntimeState.Pausing
06/01/23 19:38:00.577581 [1378] INFO RuntimeMachine - Runtime machine mode changed from RuntimeState.Pausing to RuntimeState.Paused
06/01/23 19:38:41.692580 [1378] INFO RuntimeMachine - Runtime machine mode changed from RuntimeState.Paused to RuntimeState.Stopped
6.ALARM 警报
关键字 rob1:alarm
eg.
06/01/23 19:38:00.412963 [1378] ERROR rob1:alarm - C10022: joint3 error: collision
06/02/23 08:54:20.642999 [1378] ERROR rob1:alarm - C10021: joint3 error: target speed out of range
7.脚本运行逻辑分析
以下面这个工程为例:
首先会启动脚本线程
install_dir: /root/arcs
01/02/70 22:41:26.964153 [39278] WARNING RuntimeMachine - runtime_machine.cpp:718 AAAAAAbort...
01/02/70 22:41:26.964172 [39278] INFO aubo_script - script_executor.h:26 Start script thread...
01/02/70 22:41:26.965349 [39274] TRACE_L1 RuntimeMachine - runtime_machine.cpp:566 Runtime machine mode RuntimeState.Stopped not changed. Event RuntimeEventType.Abort ignored.
01/02/70 22:41:26.965521 [39275] INFO rob1 - motion_control.cpp:1822 MotionControl abort
01/02/70 22:41:26.965547 [39275] INFO rob1::alg - trajectory_plan.hpp:1125 tpStop(StopType::EMERGENCY) ignored while PlanStatus is IDLE
01/02/70 22:41:26.965608 [39275] INFO rob1::alg - aral::updatePlanStartPoint - trajectory_setup.cpp:300 设置规划器下一段路径起始关节角为: 0.463262 -0.156283 1.43775 0.0233074 1.5708 0.463262 关节速度为: 0 0 0 0 0 0 关节加速度为: 0 0 0 0 0 0
01/02/70 22:41:26.965644 [39275] INFO rob1::alg - aral::initiateRobotModel - trajectory_setup.cpp:94 默认设置的关节最大速度: [2.5964 2.5964 2.5964 3.1105 3.1105 3.1105] 关节最大加速度: [15.7 15.7 15.7 15.7 15.7 15.7] 笛卡尔空间最大速度: [ 2 3.14] 笛卡尔空间最大加速度: [ 5 22]
01/02/70 22:41:26.965862 [39275] INFO rob1::alg - aral::scaleVelAndAcc - trajectory_speed_adjust.cpp:12 用户设置的速度比例: 1 加速度比例: 1 缓冲点个数: 0
01/02/70 22:41:26.965881 [39275] DEBUG rob1::alg - trajectory_plan.hpp:174 Init last target 0.463262,-0.156283,1.43775,0.0233074,1.5708,0.463262
01/02/70 22:41:26.966459 [39344] INFO aubo_script - script_executor.h:46 Run script:
然后发送脚本给控制器
local aubo = require('aubo')
local sched = sched or aubo.sched
local math = aubo.math or math
local sleep = sched.sleep
local thread = sched.thread
local sync = sched.sync
local run = sched.run
local kill = sched.kill
local halt = sched.halt
function p_Untitled_1()
_ENV = sched.select_robot(1)
setCollisionStopType(1)
setCollisionLevel(6)
setHomePosition({0,-0.2617993877991494,1.74532925199433,0.4363323129985824,1.570796326794897,0} )
modbusDeleteAllSignals()
setDigitalInputActionDefault()
setDigitalOutputRunstateDefault()
setStandardDigitalInputAction(5, StandardInputAction.SlowDown1)
setStandardDigitalInputAction(6, StandardInputAction.SlowDown2)
setPayload(0, {0,0,0}, {0,0,0}, {0,0,0,0,0,0,0,0,0})
setTcpOffset({0,0,0,0,0,0})
setPlanContext(sched.current_thread_id(), 1, "初始变量")
u57fau5ea7 = {0,0,0,0,0,0}
u5de5u5177 = {0,0,0,0,0,0}
u8defu70b9_0_p = {0.5390862712266159,0.133468772007148,0.422298607209269,3.141531022869428,-3.489163597303444e-05,1.570796327999991}
u8defu70b9_0_q = {0.463262,-0.156283,1.43775,0.0233074,1.5708,0.463262}
u8defu70b9_1_p = {0.5390862712266159,0.1334687720071478,0.2316999396105196,3.141531022869428,-3.489163597303869e-05,1.570796327999991}
u8defu70b9_1_q = {0.4632619999999994,-0.2827666499844659,1.81194934240131,0.523990392385776,1.5708,0.4632619999999999}
function str_cat(str1, str2)
return tostring(str1) .. tostring(str2)
end
local function calculate_point_to_move_towards(feature, direction, position_distance)
local posDir={direction[1], direction[2], direction[3]}
if (math.norm(posDir) < 1e-6) then
return getTargetTcpPose()
end
local direction_vector_normalized=math.normalize(posDir)
local displacement_pose={direction_vector_normalized[1] * position_distance,direction_vector_normalized[2] * position_distance,direction_vector_normalized[3] * position_distance,0,0,0}
local wanted_displacement_in_base_frame=poseSub(poseTrans(feature, displacement_pose), feature)
return poseAdd(getTargetTcpPose(), wanted_displacement_in_base_frame)
end
setPlanContext(sched.current_thread_id(), 2, "程序")
setPlanContext(sched.current_thread_id(), 3, "关节运动")
setPlanContext(sched.current_thread_id(), 4, "路点_0")
moveJoint(inverseKinematics(u8defu70b9_0_q, u8defu70b9_0_p), 1.39626, 1.0472, 0, 0)
setPlanContext(sched.current_thread_id(), 5, "路点_1")
moveJoint(inverseKinematics(u8defu70b9_1_q, u8defu70b9_1_p), 1.39626, 1.0472, 0, 0)
end
local app = {
PRIORITY = 1000, -- set the app priority, which determines app execution order
VERSION = "0.1",
VENDOR = "Aubo Robotics",
}
function app:start(api)
--
self.api = api
print("start---")
p_Untitled_1()
end
function app:robot_error_handler(name, err)
--
print("An error hanppen to robot "..name)
end
-- return our app object
return app
可以查看脚本在工程中的行号
8.崩溃日志
崩溃日志存放路径: /root/arcs_ws/log/.crash/
9.诊断数据
诊断数据存放路径: /root/arcs_ws/log/.trace
数据内容:
- Event occurred time: 事件出现时间
- Robot type: 机器人型号
- Software version: 软件版本
- Joint firmware version: 关节驱动版本
- Masterboard firmware version: 接口板版本
- Tool firmware version: 工具固件版本
- Pedestal firmware version: 底座固件版本
- Gravity: 重力(由三个参数表示,分别为重力在x、y、z方向上的分量)
- dyn_param: 动力学参数
- torq_constant: 力矩系数
- Joints max torq: 关节最大力矩
- Fc、Fs、Ft1、Ft2、Ft3、Fv0、Fv1、Fv2、Fv3、Vs、c1、c2、constant、frac、miu、mode、pre_friction均为摩擦力参数
- qmix: 关节最小极限值
- qman: 关节最大极限值
- Time:时间
- Id: 轨迹的id
- SafetyMode:安全状态
- UNDEF: Undefined (未定义模式)
- NOR: Normal (正常模式)
- RED: ReducedMode (缩减模式)
- REC: Recovery (恢复模式)
- VIO: Violation (违规操作)
- PS: ProtectiveStop (保护性停止)
- SS: SafeguardStop (安全防护停止)
- SES: SystemEmergencyStop (系统紧急停止)
- RES: RobotEmergencyStop (机器人紧急停止)
- FAULT: Fault(故障)
- RobotMode:机器人状态
- NC: NoController (无控制器)
- DC: Disconnected (未连接)
- CONF: ConfirmSafety (正在进行安全配置, 断电状态下进行)
- BOOT: Booting (机械臂本体正在上电初始化)
- POFF: PowerOff (机械臂本体处于断电状态)
- PON: PowerOn (机械臂本体上电成功, 刹车暂未松开(抱死), 关节初始状态未获取)
- IDLE: Idle (机械臂上电成功, 刹车暂未松开(抱死), 电机不通电, 关节初始状态获取完成)
- REL: BrakeReleasing (机械臂上电成功, 刹车正在松开)
- BKD: BackDrive (反向驱动:刹车松开, 电机不通电)
- RUN: Running (机械臂刹车松开, 运行模式, 控制权由硬件移交给软件)
- MT: Maintaince (维护模式: 包括固件升级、参数写入等)
- ERR: Error
- pose1 ~pose6: TCP实际位置(基于基坐标系下的描述)
- tcp_speed1~tcp_speed6: TCP实际速度
- elbow_speed1~elbow_speed6: ELBOW 实际速度
- q1、q2、q3、q4、q5、q6:实际关节角度
- qd1、qd2、qd3、qd4、qd5、qd6:实际关节速度
- qdd1、qdd2、qdd3、qdd4、qdd5、qdd6:实际关节加速度
- current1、current2、current3、current4、current5、current6:关节电流
- voltage1、voltage2、voltage3、voltage4、voltage5、voltage6:关节电压
- temperature1、temperature2、temperature3、temperature4、temperature5、temperature6:关节温度
- torq1~torq6: 关节力矩
- target_q1、target_q2、target_q3、target_q4、target_q5、target_q6:目标关节角
- target_qd1、target_qd2、target_qd3、target_qd4、target_qd5、target_qd6:目标速度
- target_qdd1、target_qdd2、target_qdd3、target_qdd4、target_qdd5、target_qdd6:目标加速度
- target_curr1~target_curr6: 关节目标电流
- plan_pose1~plan_pose6: TCP规划位置
- plan_q1~plan_q6: 规划的关节位置
- plan_qd1~plan_qd6: 规划的关节速度
- plan_qdd1~plan_qdd6: 规划的关节加速度
- plan_curr1~plan_curr6: 拖动算法计算出的指令电流
- Mass: 负载质量
- Com_x、Com_y、Com_z: 负载质心
- inertia1~inertia6: 负载惯量,分别为[Ixx, Iyy, Izz, Ixy, Ixz, Iyz]
- friction1~friction6: 摩擦力矩
- forces1~forces6: 力传感器读数
- freedrive: 是否使能拖动