|
@ -34,13 +34,6 @@ ZGPIO io_fybh_read4; |
|
|
ZGPIO io_fybh_read5; |
|
|
ZGPIO io_fybh_read5; |
|
|
ZGPIO io_fybh_read6; |
|
|
ZGPIO io_fybh_read6; |
|
|
|
|
|
|
|
|
// input_sensor_get_bwm_gpio() { return &FYBJL_SENSOR0; }
|
|
|
|
|
|
// input_sensor_get_py_home_gpio() { return &FYBJL_SENSOR1; }
|
|
|
|
|
|
// input_sensor_get_py_limit_gpio() { return &FYBJL_SENSOR2; }
|
|
|
|
|
|
// input_sensor_get_tj_home_gpio() { return &FYBJL_SENSOR4; }
|
|
|
|
|
|
// input_sensor_get_tj_limit_gpio() { return &FYBJL_SENSOR5; }
|
|
|
|
|
|
// input_sensor_get_card_block_detect_gpio() { return &FYBJL_SENSOR7; }
|
|
|
|
|
|
|
|
|
|
|
|
ZGPIO io_fybjl_sensor8; |
|
|
ZGPIO io_fybjl_sensor8; |
|
|
ZGPIO io_fybjl_sensor7; |
|
|
ZGPIO io_fybjl_sensor7; |
|
|
ZGPIO io_fybjl_sensor6; |
|
|
ZGPIO io_fybjl_sensor6; |
|
@ -51,9 +44,9 @@ ZGPIO io_fybjl_sensor2; |
|
|
ZGPIO io_fybjl_sensor1; |
|
|
ZGPIO io_fybjl_sensor1; |
|
|
ZGPIO io_fybjl_sensor0; |
|
|
ZGPIO io_fybjl_sensor0; |
|
|
|
|
|
|
|
|
|
|
|
DeviceBaseControlService m_deviceBaseControlService; |
|
|
SingleAxisMotorControlerV2 m_pyMotorControlService; // 平移电机
|
|
|
SingleAxisMotorControlerV2 m_pyMotorControlService; // 平移电机
|
|
|
SingleAxisMotorControlerV2 m_tjMotorControlService; // 推进电机
|
|
|
SingleAxisMotorControlerV2 m_tjMotorControlService; // 推进电机
|
|
|
|
|
|
|
|
|
OneDimensionalCodeLaserScanner m_oneDimensionalCodeLaserScanner; |
|
|
OneDimensionalCodeLaserScanner m_oneDimensionalCodeLaserScanner; |
|
|
|
|
|
|
|
|
void input_sensors_init() { |
|
|
void input_sensors_init() { |
|
@ -164,7 +157,7 @@ void Main::run() { |
|
|
/*******************************************************************************
|
|
|
/*******************************************************************************
|
|
|
* 协议栈初始化 * |
|
|
* 协议栈初始化 * |
|
|
*******************************************************************************/ |
|
|
*******************************************************************************/ |
|
|
{ |
|
|
|
|
|
|
|
|
{ //
|
|
|
auto *cfg = IflytopCanProtocolStackProcesser::createDefaultConfig(DEVICE_ID, 128); |
|
|
auto *cfg = IflytopCanProtocolStackProcesser::createDefaultConfig(DEVICE_ID, 128); |
|
|
m_protocolStack.initialize(cfg); |
|
|
m_protocolStack.initialize(cfg); |
|
|
m_protocolStack.setDumpPacketFlag(false); |
|
|
m_protocolStack.setDumpPacketFlag(false); |
|
@ -172,6 +165,14 @@ void Main::run() { |
|
|
m_protocolStack.activeReg(REG_GPIO_INPUT0, icps::kwr, 0); |
|
|
m_protocolStack.activeReg(REG_GPIO_INPUT0, icps::kwr, 0); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
{ //
|
|
|
|
|
|
m_deviceBaseControlService.initialize(&m_protocolStack, DEVICE_ID); |
|
|
|
|
|
m_deviceBaseControlService.setListener([](int32_t engineer_mode) { |
|
|
|
|
|
m_pyMotorControlService.setEngineerMode(engineer_mode); |
|
|
|
|
|
m_tjMotorControlService.setEngineerMode(engineer_mode); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
/*******************************************************************************
|
|
|
* 横移电机 * |
|
|
* 横移电机 * |
|
|
*******************************************************************************/ |
|
|
*******************************************************************************/ |
|
@ -223,9 +224,9 @@ void Main::run() { |
|
|
m_tjMotorControlService.cfg_runtohome_leave_zero_point_distance->setVal(256 * 200 * 1); |
|
|
m_tjMotorControlService.cfg_runtohome_leave_zero_point_distance->setVal(256 * 200 * 1); |
|
|
|
|
|
|
|
|
// bwm_gpio
|
|
|
// bwm_gpio
|
|
|
|
|
|
|
|
|
m_oneDimensionalCodeLaserScanner.initialize(&m_protocolStack, REG_LARSER_SCANNER_CTRL_ADD_BASE, FYBJL_SENSOR0, [this]() { return m_tj_motor.getXACTUAL(); }); |
|
|
m_oneDimensionalCodeLaserScanner.initialize(&m_protocolStack, REG_LARSER_SCANNER_CTRL_ADD_BASE, FYBJL_SENSOR0, [this]() { return m_tj_motor.getXACTUAL(); }); |
|
|
|
|
|
|
|
|
|
|
|
ZLOGI(TAG, "init done"); |
|
|
while (1) { |
|
|
while (1) { |
|
|
ZHALCORE::getInstance()->loop(); |
|
|
ZHALCORE::getInstance()->loop(); |
|
|
} |
|
|
} |
|
|