max step<65
This commit is contained in:
@@ -124,7 +124,7 @@ private:
|
||||
///bool activated_;
|
||||
std::atomic<bool> activated_{false};
|
||||
#define FREQUENCY 1000
|
||||
#define CSP_MAX_VEL_COUNTS_PER_S 10000//65536
|
||||
#define CSP_MAX_VEL_COUNTS_PER_S 65536
|
||||
#define CSP_POS_DEADBAND 10
|
||||
#define CSP_DEADBAND1 100 //CSP允许的误差(计数),原来是10
|
||||
#define CSP_DEADBAND2 500
|
||||
|
||||
@@ -672,7 +672,7 @@ void EthercatDriver::readData(){
|
||||
///
|
||||
//if(pos_cnt++%500==0)
|
||||
// RCLCPP_INFO(rclcpp::get_logger("EthercatDriver"), "[%d],cur:%d,dst:%.1f",i,pos,target_pos);
|
||||
#if 0
|
||||
#if 1
|
||||
vmax_acc[i] += (int64_t)CSP_MAX_VEL_COUNTS_PER_S; // +v [counts/s]
|
||||
int32_t max_step = (int32_t)(vmax_acc[i] / FREQUENCY); // 下取整,得到本周期可用步长
|
||||
vmax_acc[i] -= (int64_t)max_step * FREQUENCY; // 保留余数到下周期
|
||||
|
||||
Reference in New Issue
Block a user