Skip to content

Commit

Permalink
Merge pull request jsk-ros-pkg#586 from tongtybj/PR/spinal/STM32H7/IMU
Browse files Browse the repository at this point in the history
[Spinal][STM32H7] correct the initialization order of spinal-IMU
  • Loading branch information
tongtybj authored Dec 26, 2023
2 parents 2936b05 + cd71535 commit 8375287
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ int main(void)
#endif

imu_.init(&hspi1, &hi2c3, &nh_, IMUCS_GPIO_Port, IMUCS_Pin, LED0_GPIO_Port, LED0_Pin);
IMU_ROS_CMD::init(&nh_);
IMU_ROS_CMD::addImu(&imu_);
baro_.init(&hi2c1, &nh_, BAROCS_GPIO_Port, BAROCS_Pin);
gps_.init(&huart3, &nh_, LED2_GPIO_Port, LED2_Pin);
battery_status_.init(&hadc1, &nh_);
Expand Down Expand Up @@ -1042,8 +1044,6 @@ void coreTaskFunc(void const * argument)
nh_.initNode(dst_addr, 12345,12345);
#endif

IMU_ROS_CMD::init(&nh_);
IMU_ROS_CMD::addImu(&imu_);
imu_.gyroCalib(true, IMU::GYRO_DEFAULT_CALIB_DURATION); // re-calibrate gyroscope because of the HAL_Delay in spine init

osSemaphoreWait(coreTaskSemHandle, osWaitForever);
Expand Down

0 comments on commit 8375287

Please sign in to comment.