Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to read #1

Open
miguelao33 opened this issue Oct 4, 2023 · 16 comments
Open

Unable to read #1

miguelao33 opened this issue Oct 4, 2023 · 16 comments

Comments

@miguelao33
Copy link

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
Copy link
Author

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
Copy link
Owner

NDHANA94 commented Oct 5, 2023

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

@miguelao33
Copy link
Author

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
Copy link
Owner

NDHANA94 commented Oct 5, 2023

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
Copy link
Author

Thanks Nipun, have a nice one!

@NDHANA94
Copy link
Owner

NDHANA94 commented Oct 5, 2023

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
Copy link
Author

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
Copy link
Owner

NDHANA94 commented Oct 5, 2023

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

@miguelao33
Copy link
Author

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
Copy link
Author

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
Copy link
Owner

NDHANA94 commented Oct 6, 2023

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
Copy link
Owner

NDHANA94 commented Oct 6, 2023

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

@NDHANA94
Copy link
Owner

NDHANA94 commented Oct 6, 2023

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
Copy link
Author

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
Copy link
Author

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
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants