NDHANA94 / ros2_wheeltec_n100_imu

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

Unable to read #1

Open miguelao33 opened 11 months ago

miguelao33 commented 11 months ago

Hello,

I just bought a N100 IMU and after a lot of trying, it seems serial is working incorrectly. When I use your code to get something published, If i use any other baud rate I can see weird values, but when I use your suggested baudrate (same i got from dealer) then i get segmentation fault. Do you have any idea what could be happening? Screenshot from 2023-10-04 19-25-37

miguelao33 commented 11 months ago

Also, If i debug it, I can see the header meesage will always be FC which is ok, but i cannot identify the problem with it.

image

NDHANA94 commented 11 months ago

Hi! U can't use random values for baudrate (119200 is not standard) . Try with standard baud rates, such as 115200.

miguelao33 commented 11 months ago

Hello!

Yeap, I try to use all what i found, also tried with 115200 but it only seems to work with the default one, the issue is that it stops. Im runing humble on Ubuntu 22.04 image

NDHANA94 commented 11 months ago

I created this PKG for the ROS2 Foxy Version. It seems like for humble the PKG needs to be modified. I will check and give u feedback later.

miguelao33 commented 11 months ago

Thanks Nipun, have a nice one!

NDHANA94 commented 11 months ago

try this... remove all other python serial libraries. and install pyserial using pip3 install pyserial cmd. I think u have not correct serial library.

miguelao33 commented 11 months ago

I had a serial package on my dev space but now that I took it out, it cannot find serial lib. When i tryed to install it, is already there on usr/lib/python3/dist-packages.

any hints? image

NDHANA94 commented 11 months ago

Try cloning this ros2 serial package in src directory of ur ros2 workspace: https://github.com/RoverRobotics-forks/serial-ros2.git

miguelao33 commented 11 months ago

Hello Nipun,

I started a new workspace only with those 2 packages and I'm getting same result. Maybe because of the sourcing? Or could be something with the usb connection/permission?

image

miguelao33 commented 11 months ago

Also, if I sudo dmesg, I just see this:

image

thanks for your help! as you can see, im just starting with this world :(

NDHANA94 commented 11 months ago

If u have not given USB device access permission, please run following two commands to give the access.

sudo usermod -a -G dialout $USER
sudo chmod a+rw /dev/ttyUSB0
NDHANA94 commented 11 months ago

I used this PKG with the humble version. No error occurs

NDHANA94 commented 11 months ago

Hello Nipun,

I started a new workspace only with those 2 packages and I'm getting same result. Maybe because of the sourcing? Or could be something with the usb connection/permission?

image

Can you double check whether ur IMU device name is ttyUSB0 or ttyACM0 ?

miguelao33 commented 11 months ago

Hello Nipun,

Yes, it is on ttyUSB0, I've created the rule at the beginning, and I also give them the permissions.

I found this: https://github.com/Carpediem324/WHEELTEC_N100_IMU_ROS2/tree/main test it on both serial packages and it works ok. I've clone it also to my main devspace and it works great with all other devices. I look vaguely where is the difference but I didnt spot it. Maybe you will.

Thanks for all your time and contributions! I saw and like your youtube videos!

image

Regards

miguelao33 commented 10 months ago

Hello Nipun,

I'm again using your library to my imu wheeltec n100 but on the magnetic pose 2d, Theta parameter wich is only important one right now to orient my robot, is getting very weird values.. I used a compass and get those values when pointed the X axis of the Imu in those 4 direcctions.:

North 3.9 East 2.6 South 2.4 West 4.8

This is just an echo from magnetic_pose_2d. image

In general I cannot see any path there because it doesnt go smoothly trough 0-6.28 as I rotate. Is just jumping from 2 to 5 directly and consinstenly (or from 4 to 0) so i think is not a error on the sensor. Also I have 2 n100 modules (not the same model, one is mini) and the results are exactly the same.

Do you think it could be something about the serial library? or maybe calibration for the sensor which i never did because i dont know where to download the fdlink ground control?

Thanks for your reply!

NDHANA94 commented 9 months ago

Hi Miguel! Unfortunately currently I don't have this sensor with me to check this issue. Most probably, yes, u have to calibrate the sensor, or something wrong with how decode the sensor data in the code.