RoboMaster / RoboRTS-Firmware

RoboRTS infantry control firmware
Other
371 stars 200 forks source link

The Shoot Control Problem #6

Closed lyziew closed 6 years ago

lyziew commented 6 years ago

Hello. I met a problem during my development. I want to control the shooting device use api porvide by RoboRTS there some difference between RoboRTS and RoboRTS-Firmware on the fric_wheel_spd in RoboRTS. range is 1-100 in RoboRTS-Firmware,range is 1000-2000 when i set fric_wheel_spd = 1, is ok the wheel run well, but when i set "fric_wheel_spd" more then one , the wheel did not run, is there a shoot control sample or is there some wrong with the RoboRTS-Firmware

eeluobu commented 6 years ago

If there is a difference, take the protocol document of RoboRTS-Firmware as the criterion

lyziew commented 6 years ago

@eeluobu hi I found that in shoot_task.h the fric_wheel_spd type is uint16_t but in message where the RoboRTS-Firmware received ,the fric_wheel_spd is uint8_t, it means that i can not set fric_wheel_spd more than 255, but the range is 1000-2000 ,is there something wrong ? typedef __packed struct { / shoot task relevant param / shoot_mode_e ctrl_mode; uint8_t shoot_cmd; uint32_t c_shoot_time; //continuous uint8_t c_shoot_cmd; uint8_t fric_wheel_run; //run or not uint16_t fric_wheel_spd; uint16_t shoot_bullets; uint16_t remain_bullets; } shoot_t;

typedef __packed struct { uint8_t shoot_cmd; / single shoot command / uint8_t c_shoot_cmd; / continuous shoot command / uint8_t fric_wheel_run; / friction run or not / uint8_t fric_wheel_spd; / fricrion wheel speed / } shoot_ctrl_t;

eeluobu commented 6 years ago

I'm sorry, this is an error in the protocol data ‘shoot_ctrl_t’, and we've changed it.