|
@ -163,7 +163,26 @@ void script_reg_fn() { |
|
|
}); |
|
|
}); |
|
|
#endif
|
|
|
#endif
|
|
|
|
|
|
|
|
|
g_cmdScheduler.regCMD("xy_robot_ctrl_get_base_param", "(id)", 1, [](int32_t paramN, const char** paraV, ICmdParserACK* ack) { g_zmodule_device_script_cmder_paser.do_dumpconfig(paramN, paraV, ack); }); |
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
g_cmdScheduler.regCMD("xy_robot_ctrl_read_status", "(id)", 1, [](int32_t paramN, const char** paraV, ICmdParserACK* ack) { |
|
|
|
|
|
int32_t x; |
|
|
|
|
|
int32_t y; |
|
|
|
|
|
int32_t errocode; |
|
|
|
|
|
int32_t status; |
|
|
|
|
|
|
|
|
|
|
|
g_zmodule_device_manager.xymotor_read_pos(XY_ROBOT_ID, &x, &y); |
|
|
|
|
|
g_zmodule_device_manager.module_get_error(XY_ROBOT_ID, &errocode); |
|
|
|
|
|
g_zmodule_device_manager.module_get_status(XY_ROBOT_ID, &status); |
|
|
|
|
|
|
|
|
|
|
|
ZLOGI(TAG, "x,y:%d,%d", x, y); |
|
|
|
|
|
ZLOGI(TAG, "errocode:%d", errocode); |
|
|
|
|
|
ZLOGI(TAG, "status:%d", status); |
|
|
|
|
|
|
|
|
|
|
|
g_zmodule_device_script_cmder_paser.do_dumpstate(XY_ROBOT_ID); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
g_cmdScheduler.regCMD("xy_robot_ctrl_get_base_param", "(id)", 1, [](int32_t paramN, const char** paraV, ICmdParserACK* ack) { g_zmodule_device_script_cmder_paser.do_dumpconfig(XY_ROBOT_ID); }); |
|
|
|
|
|
|
|
|
g_cmdScheduler.regCMD("xy_robot_ctrl_move_by", "(id,dx,dy,v)", 4, [](int32_t paramN, const char** paraV, ICmdParserACK* ack) { |
|
|
g_cmdScheduler.regCMD("xy_robot_ctrl_move_by", "(id,dx,dy,v)", 4, [](int32_t paramN, const char** paraV, ICmdParserACK* ack) { |
|
|
int32_t dx = atoi(paraV[1]); |
|
|
int32_t dx = atoi(paraV[1]); |
|
@ -264,8 +283,6 @@ void script_reg_fn() { |
|
|
g_zmodule_device_manager.module_get_status(4, &status); |
|
|
g_zmodule_device_manager.module_get_status(4, &status); |
|
|
|
|
|
|
|
|
ZLOGI(TAG, "pos:%d,errocode:%d,status:%d", pos, errocode, status); |
|
|
ZLOGI(TAG, "pos:%d,errocode:%d,status:%d", pos, errocode, status); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
// g_cmdScheduler.regCMD("step_motor_ctrl_rotate", "(id,speed,lastforms)", 3, [](int32_t paramN, const char** paraV, ICmdParserACK* ack) {
|
|
|
// g_cmdScheduler.regCMD("step_motor_ctrl_rotate", "(id,speed,lastforms)", 3, [](int32_t paramN, const char** paraV, ICmdParserACK* ack) {
|
|
|