fix enable
This commit is contained in:
parent
50d6c0b337
commit
e9e2d62662
@ -212,6 +212,7 @@ public:
|
|||||||
// 更新每个关节
|
// 更新每个关节
|
||||||
for (Joint* joint : joints_) { // 遍历关节数组
|
for (Joint* joint : joints_) { // 遍历关节数组
|
||||||
if (joint) {
|
if (joint) {
|
||||||
|
joint->Enable();
|
||||||
joint->Update();
|
joint->Update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,28 +23,28 @@ Config_RobotParam_t robot_config = {
|
|||||||
/* DJI3508µç»ú*/
|
/* DJI3508µç»ú*/
|
||||||
.motor_param = {
|
.motor_param = {
|
||||||
{
|
{
|
||||||
.can = BSP_CAN_2,
|
.can = BSP_CAN_1,
|
||||||
.id = 0x201,
|
.id = 0x201,
|
||||||
.module = MOTOR_M3508,
|
.module = MOTOR_M3508,
|
||||||
.reverse = false,
|
.reverse = false,
|
||||||
.gear = true
|
.gear = true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.can = BSP_CAN_2,
|
.can = BSP_CAN_1,
|
||||||
.id = 0x202,
|
.id = 0x202,
|
||||||
.module = MOTOR_M3508,
|
.module = MOTOR_M3508,
|
||||||
.reverse = false,
|
.reverse = false,
|
||||||
.gear = true
|
.gear = true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.can = BSP_CAN_2,
|
.can = BSP_CAN_1,
|
||||||
.id = 0x203,
|
.id = 0x203,
|
||||||
.module = MOTOR_M3508,
|
.module = MOTOR_M3508,
|
||||||
.reverse = false,
|
.reverse = false,
|
||||||
.gear = true
|
.gear = true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.can = BSP_CAN_2,
|
.can = BSP_CAN_1,
|
||||||
.id = 0x204,
|
.id = 0x204,
|
||||||
.module = MOTOR_M3508,
|
.module = MOTOR_M3508,
|
||||||
.reverse = false,
|
.reverse = false,
|
||||||
|
|||||||
@ -286,13 +286,10 @@ void Task_arm_main(void* argument) {
|
|||||||
|
|
||||||
osMessageQueueGet(task_runtime.msgq.arm.cmd, &arm_cmd, NULL, 0);
|
osMessageQueueGet(task_runtime.msgq.arm.cmd, &arm_cmd, NULL, 0);
|
||||||
|
|
||||||
// 使能状态变化沿处理:仅在变化时下发使能,减少冗余调用
|
|
||||||
static bool last_enable = false;
|
|
||||||
if (arm_cmd.enable != last_enable) {
|
|
||||||
robot_arm->Enable(arm_cmd.enable);
|
robot_arm->Enable(arm_cmd.enable);
|
||||||
}
|
|
||||||
|
|
||||||
// 使能上升沿自动同步:避免使能时 target_pose 与当前实际位姿不一致导致初始跳变
|
// 使能上升沿自动同步:避免使能时 target_pose 与当前实际位姿不一致导致初始跳变
|
||||||
|
static bool last_enable = false;
|
||||||
if (arm_cmd.enable && !last_enable) {
|
if (arm_cmd.enable && !last_enable) {
|
||||||
SyncCommandTargetFromCurrent();
|
SyncCommandTargetFromCurrent();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user