allenh1 / rplidar_ros

BSD 2-Clause "Simplified" License
42 stars 43 forks source link

rplidar_s1 operation timeout #8

Closed adamkrawczyk closed 4 years ago

adamkrawczyk commented 4 years ago

Hey,

I got rplidar s1 connected to Asus tinker board but can't run this.

ros2 launch rplidar_ros rplidar_s1.launch.py 

[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [rplidar_composition-1]: process started with pid [23259]
[rplidar_composition-1] [ERROR] [rplidar_composition]: Error, operation time out. RESULT_OPERATION_TIMEOUT!

I have checked /dev and baud rate

Bert-Tec commented 4 years ago

I have the same problem on a A3, any solutions? With the ros1 node it works and I tried different power sources. dmseg: rplidar_composi[12274]: segfault at 7f64ddf1e010 ip 00007f64dd56df4a sp 00007ffe99aac7c0 error 4 in librplidar_composition_node.so[7f64dd4e0000+dd000] ls -al /dev/ttyUSB0: crw-rw---- 1 root dialout 188, 0 Apr 24 08:21 /dev/ttyUSB0

Bert-Tec commented 4 years ago

I went nearly thru every code and then I found the obviously error. The parameters in the launch file don't work so the s1 and a3 a trying to connect at the wrong baud rate which is set in the code. I think that's not the correct way to set parameters in a launch file for ros2 @allenh1 can you check and correct that?

Thanks

allenh1 commented 4 years ago

Sure -- I can find some time and fix it. Thanks for investigating.

allenh1 commented 4 years ago

I think that's not the correct way to set parameters in a launch file for ros2

@Bert-Tec The launchfile looks correct to me, but the way I set it in the implementation was not up to date. Since ROS 2 has parameters as of a while ago, there's no need in me keeping the get_parameter_or function calls and can instead use the declare_parameter function instead.

Let me know if that fixes it (I suspect it will). If not, we'll keep investigating. Cheers.

Bert-Tec commented 4 years ago

Thanks much! I will test it when I'm back on Monday. I have a a3, so I can test for that, not for s1. But should be the same.

allenh1 commented 4 years ago

Thanks much!

Not a problem! I'm glad to see people using this! I'm perfectly willing to continue to support it in ROS 2 (since the slamtec people seem disinterested in it).

There is quite a bit to be cleaned up from the original code (this was a hastily done port for a demo originally), so I might do some more cleanup in the near future, as well as release debians.

I will test it when I'm back on Monday. I have a a3, so I can test for that, not for s1.

That's fine! I'll also just run the node on my desktop and verify that the parameters are being set as specified by the launch files. That should be evidence enough for me to merge it.

Bert-Tec commented 4 years ago

It works now with the rplidar a3. But the scan_mode doesn't work, at least it says in the console still current scan mode: Sensitivity, when I change to Boost.

allenh1 commented 4 years ago

It works now with the rplidar a3.

:tada: that's good news!

current scan mode: Sensitivity, when I change to Boost.

@Bert-Tec did you build with --symlink-install? If not, you likely have to run the colcon build again for your changes to make it into the launchfile. I'll take a look at this, though.

adamkrawczyk commented 4 years ago

How about s1? I'm not able to check right now but... any good news?

allenh1 commented 4 years ago

How about s1? I'm not able to check right now but... any good news?

I think it should work if the a3 works. I'm going to merge the PR now, please comment when you get a chance to test for s1.

@Bert-Tec I just fixed the scan_mode printing, should be more verbose now.

adamkrawczyk commented 4 years ago

Unfortunately s1 still not working. Log file doesn't say more than operation timeout.