| xCore-SDK 0.5.0 xCore SDK C# API

welding_cli.hpp
1#ifndef XCORESDK_SRC_MANAGED_WELDING_CLI_HPP_
2#define XCORESDK_SRC_MANAGED_WELDING_CLI_HPP_
3
4#include <unordered_map>
5#include "data_types_cli.hpp"
6#include "exception_cli.hpp"
7
8 using namespace System;
9 using namespace System::Collections::Generic;
10 using namespace System::Runtime::InteropServices;
11
12 namespace rokae {
13 class BaseWelding;
14}
15
16 namespace rokae::clr {
17
21 public value struct LaserTrackParams {
25 static LaserTrackParams Default = {
26 0.01, // vel_max
27 0.2, // acc_max
28 2.0, // jerk_max
29 5.0, // filter_window_size
30 0.2, // filter_data
31 0.2, // filter_track
32 0.06, // delay_time
33 0.05, // cycle_time
34 true, // dir_y_enable
35 0.02, // dir_y_max
36 true, // dir_z_enable
37 0.02, // dir_z_max
38 "xz" // coord_feature
39 };
40
44 Double vel_max;
48 Double acc_max;
52 Double jerk_max;
56 Double filter_window_size;
60 Double filter_data;
64 Double filter_track;
68 Double delay_time;
72 Double cycle_time;
76 Boolean dir_y_enable;
80 Double dir_y_max;
84 Boolean dir_z_enable;
88 Double dir_z_max;
96 String^ coord_feature;
97 };
98
99 public ref class Welding {
100
101 protected:
102 rokae::BaseWelding* ptr;
103
104 public:
105
106 Welding(rokae::BaseWelding*);
107
108 virtual ~Welding();
109
118 void setWeave(bool enable, double frequency, double amplitude, array<double>^ dwell_time, [Out] ErrorCode ^ %ec);
119
126 void setSwingMotion(double acceleration, double jerk, [Out] ErrorCode^% ec);
134 void setWeaveParameters(double frequency, double amplitude, array<double>^ dwell_time, [Out] ErrorCode^% ec);
135
144 void calcWeldOffset(Frame^% start, Frame^ start_offs, Frame^% target, Frame^ target_offs, [Out] ErrorCode^% ec);
145
156 void calcWeldOffset(Frame^% start, Frame^ start_offs, Frame^% target, Frame^ target_offs, Frame^% aux, Frame^ aux_offs, [Out] ErrorCode^% ec);
157
166 void calcWeldOffsetCalculatedZ(Frame^% start, Frame^ start_offs, Frame^% target, Frame^ target_offs, [Out] ErrorCode^% ec);
167
178 void calcWeldOffsetCalculatedZ(Frame^% start, Frame^ start_offs, Frame^% target, Frame^ target_offs, Frame^% aux, Frame^ aux_offs, [Out] ErrorCode^% ec);
179
196 void transformOffsetByTeaching(Frame^ start, Frame^ target,
197 Frame^ teach_point_1, double offset_1,
198 Frame^ teach_point_2, double offset_2,
199 array<double>^% offset_start, array<double>^% offset_target,
200 [Out] ErrorCode^% ec);
201
219 List<List<Frame^>^>^ calcWeldOffset_Multi(List<Frame^>^ way_points, List<Frame^>^ teach_points, List<array<double>^>^ offsets, int% error_index, [Out] ErrorCode^% ec);
220
226 void adjustTrackOffset(array<double>^ offset, [Out] ErrorCode^% ec);
227
241 void bindWeaveDo(String^ signal,String^ action, bool value, [Out] ErrorCode^% ec);
242
248 void unbindWeaveDo(String^ signal, [Out] ErrorCode^% ec) ;
249
254 void startTracking([Out] ErrorCode^% ec);
255
260 void stopTracking([Out] ErrorCode^% ec);
261
269 void addLaserTrackOffset(double x, double z, Boolean valid, [Out] ErrorCode^% ec);
270
279 void addLaserTrackOffset(double x, double y, double z, Boolean valid, [Out] ErrorCode^% ec);
280
286 void setSensorFrame(Frame^ sensor_frame, [Out] ErrorCode^% ec);
287
293 void setLaserTrackParameters(LaserTrackParams params, [Out] ErrorCode^% ec);
294
295};
296
297}
298
299#endif //XCORESDK_SRC_MANAGED_WELDING_CLI_HPP_
rokae::clr::ErrorCode
xCoreSDK错误码
Definition: data_types_cli.hpp:23
rokae::clr::Frame
坐标系
Definition: data_types_cli.hpp:289
rokae::clr::Welding
Definition: welding_cli.hpp:99
rokae::clr::Welding::startTracking
void startTracking([Out] ErrorCode^% ec)
开始激光跟踪
rokae::clr::Welding::adjustTrackOffset
void adjustTrackOffset(array< double >^ offset, [Out] ErrorCode^% ec)
电弧跟踪偏移 - 调整焊道偏移量
rokae::clr::Welding::calcWeldOffsetCalculatedZ
void calcWeldOffsetCalculatedZ(Frame^% start, Frame^ start_offs, Frame^% target, Frame^ target_offs, [Out] ErrorCode^% ec)
多层多道偏移 - 计算直线轨迹偏移。偏移量的参考坐标系并非焊道坐标系，X,Y轴采用焊道坐标系，而Z轴由X,Y轴叉乘得到。
rokae::clr::Welding::bindWeaveDo
void bindWeaveDo(String^ signal, String^ action, bool value, [Out] ErrorCode^% ec)
设置摆动过程中DO输出规则。和设置系统IO类似，但不保存设置，重启后需要重新设置。 开始DO输出的时机为通过接口绑定DO号后，非摆动轨迹默认DO全部置0，如果开启摆动，则按照设定规则输出。
rokae::clr::Welding::transformOffsetByTeaching
void transformOffsetByTeaching(Frame^ start, Frame^ target, Frame^ teach_point_1, double offset_1, Frame^ teach_point_2, double offset_2, array< double >^% offset_start, array< double >^% offset_target, [Out] ErrorCode^% ec)
多层多道辅助接口 - 根据指定的直线轨迹起点和终点，以及两个偏移方向，按指定的偏移距离进行坐标系转换， 使偏移量相对的坐标系与calcWeldOffsetCalculatedZ()接口中的一致
rokae::clr::Welding::addLaserTrackOffset
void addLaserTrackOffset(double x, double y, double z, Boolean valid, [Out] ErrorCode^% ec)
设置添加激光跟踪偏移
rokae::clr::Welding::unbindWeaveDo
void unbindWeaveDo(String^ signal, [Out] ErrorCode^% ec)
取消设置摆动过程中DO输出
rokae::clr::Welding::setSensorFrame
void setSensorFrame(Frame^ sensor_frame, [Out] ErrorCode^% ec)
设置激光器相对tcp坐标
rokae::clr::Welding::setSwingMotion
void setSwingMotion(double acceleration, double jerk, [Out] ErrorCode^% ec)
设置摆动加速度和加加速度
rokae::clr::Welding::setLaserTrackParameters
void setLaserTrackParameters(LaserTrackParams params, [Out] ErrorCode^% ec)
设置激光跟踪参数。需要在开始跟踪之前调用
rokae::clr::Welding::calcWeldOffset
void calcWeldOffset(Frame^% start, Frame^ start_offs, Frame^% target, Frame^ target_offs, Frame^% aux, Frame^ aux_offs, [Out] ErrorCode^% ec)
多层多道偏移 - 计算圆弧轨迹沿焊道坐标系的偏移
rokae::clr::Welding::calcWeldOffset_Multi
List< List< Frame^>^> calcWeldOffset_Multi(List< Frame^>^ way_points, List< Frame^>^ teach_points, List< array< double >^>^ offsets, int% error_index, [Out] ErrorCode^% ec)
多层多道偏移 - 多条轨迹，适用于平角焊/平焊/横焊
rokae::clr::Welding::setWeave
void setWeave(bool enable, double frequency, double amplitude, array< double >^ dwell_time, [Out] ErrorCode ^ %ec)
开始/停止摆动。开始摆动时可设置摆动参数
rokae::clr::Welding::setWeaveParameters
void setWeaveParameters(double frequency, double amplitude, array< double >^ dwell_time, [Out] ErrorCode^% ec)
设置摆动参数，支持在摆动过程中调整
rokae::clr::Welding::addLaserTrackOffset
void addLaserTrackOffset(double x, double z, Boolean valid, [Out] ErrorCode^% ec)
设置添加激光跟踪偏移
rokae::clr::Welding::calcWeldOffset
void calcWeldOffset(Frame^% start, Frame^ start_offs, Frame^% target, Frame^ target_offs, [Out] ErrorCode^% ec)
多层多道偏移 - 计算直线轨迹沿焊道坐标系的偏移
rokae::clr::Welding::stopTracking
void stopTracking([Out] ErrorCode^% ec)
结束激光跟踪
rokae::clr::Welding::calcWeldOffsetCalculatedZ
void calcWeldOffsetCalculatedZ(Frame^% start, Frame^ start_offs, Frame^% target, Frame^ target_offs, Frame^% aux, Frame^ aux_offs, [Out] ErrorCode^% ec)
多层多道偏移 - 计算圆弧轨迹偏移。偏移量的参考坐标系并非焊道坐标系，X,Y轴采用焊道坐标系，而Z轴由X,Y轴叉乘得到。
data_types_cli.hpp
rokae::clr::LaserTrackParams
激光跟踪参数
Definition: welding_cli.hpp:21
rokae::clr::LaserTrackParams::cycle_time
Double cycle_time
激光器数据刷新周期，与addLaserTrackOffset()调用周期保持一致，建议为激光器允许的最大刷新周期，范围[0, 0.5]s
Definition: welding_cli.hpp:72
rokae::clr::LaserTrackParams::dir_z_enable
Boolean dir_z_enable
焊道坐标系Z方向是否启用跟踪偏移
Definition: welding_cli.hpp:84
rokae::clr::LaserTrackParams::filter_data
Double filter_data
激光器数据指数滑动滤波因子，范围[0, 1], 建议值: 0.2
Definition: welding_cli.hpp:60
rokae::clr::LaserTrackParams::jerk_max
Double jerk_max
跟踪偏移值的最大加加速度, 单位: 米/秒^3, 范围(0, +∞), 建议值: 2.0m/s^3
Definition: welding_cli.hpp:52
rokae::clr::LaserTrackParams::dir_y_enable
Boolean dir_y_enable
激光器坐标系Y方向是否启用跟踪偏移
Definition: welding_cli.hpp:76
rokae::clr::LaserTrackParams::delay_time
Double delay_time
激光器数据延迟时间，用于与TCP数据对齐, 单位: 秒, 范围[0, +∞]。不同激光器延迟时间不同，明图建议值为0.06s，创想建议值为0.12s
Definition: welding_cli.hpp:68
rokae::clr::LaserTrackParams::filter_window_size
Double filter_window_size
激光器数据中值滤波窗口大小, 范围[0, 10], 建议值: 5.0 (过大产生滤波滞后)
Definition: welding_cli.hpp:56
rokae::clr::LaserTrackParams::dir_y_max
Double dir_y_max
焊道坐标系Y方向最大跟踪偏移值，超过该值停止跟踪和运动，范围[0, +∞]m
Definition: welding_cli.hpp:80
rokae::clr::LaserTrackParams::Default
static LaserTrackParams Default
默认激光跟踪参数
Definition: welding_cli.hpp:25
rokae::clr::LaserTrackParams::acc_max
Double acc_max
跟踪偏移值的最大加速度, 单位: 米/秒^2, 范围(0, +∞), 建议值: 0.2m/s^2
Definition: welding_cli.hpp:48
rokae::clr::LaserTrackParams::filter_track
Double filter_track
跟踪偏移值指数滑动滤波因子，范围[0, 1], 建议值: 0.2
Definition: welding_cli.hpp:64
rokae::clr::LaserTrackParams::vel_max
Double vel_max
跟踪偏移值的最大速度, 单位: 米/秒, 范围(0, +∞), 建议值: 0.01m/s
Definition: welding_cli.hpp:44
rokae::clr::LaserTrackParams::coord_feature
String coord_feature
激光器坐标系的方向特征，需要在跟踪前调用。目前支持： "xz" - 创想为XZ有效，激光器的写入有效数据为(X,0,Z) "yz" - 明图为YZ有效，激光器的写入有效数据为(0,...
Definition: welding_cli.hpp:96
rokae::clr::LaserTrackParams::dir_z_max
Double dir_z_max
焊道坐标系Z方向最大跟踪偏移值，超过该值停止跟踪和运动，范围[0, +∞]m
Definition: welding_cli.hpp:88