NDHANA94 / ros2_wheeltec_n100_imu

ROS2 driver pkg for wheeltec N100 IMU module.
7 stars 1 forks source link

Error while building #4

Closed hessaHamad closed 8 months ago

hessaHamad commented 8 months ago

Dear,

thank you for providing this driver, i have been trying to build it for a week. The attached photo shows the errors i get:

photo1707650823

OS = Linux (ubuntu 18.04) Jetson Nano Developer kit ROS2 Crystal (since it is the latest for ubuntu 18.04)

thank you BR,

NDHANA94 commented 8 months ago

Hi!

It seems like Crystal version has no declare_parameter function. Try removing declare_parameter lines. And get_parameter line. To do so, comment out 18-55 lines and 59-78 lines in src/imu_node.cpp. Then initialize variables with values as following (from line 129 - 158);


bool if_debug_ = false;

// serial
std::string serial_port_ = "/dev/ttyACM0";
std::uint32_t serial_baud_ = 921600;
std::uint8_t serial_timeout_ = 20;

// sum info
int sn_lost_ = 0;
int crc_error_ = 0;
uint8_t read_sn_ = 0;
bool frist_sn_;
int device_type_ = 1;

// covariance info
std::vector<double> imu_mag_cov = IMY_MAG_COV;
std::vector<double> imu_gyro_cov = IMU_GYRO_COV;
std::vector<double> imu_accel_cov = IMU_ACCEL_COV;

// ros2 topics
std::string imu_topic_ = "imu";
std::string mag_pose_2d_topic_ = "magnetic_pose_2d";
std::string imu_trueEast_topic_ = "imu_trueEast";
std::string mag_topic_ = "magnetic_field"

// ros2 frame
std::string imu_frame_id_ = "imu";

// others
double yaw_offset_ = -2.094;
tf2::Quaternion q_rot;
double mag_offset_x_ = 0.0;
double mag_offset_y_ = 0.0;
double mag_offset_z_ = 0.0;
double mag_covariance_;