yujinrobot / kobuki_core

Core (non-ros) kobuki packages.
68 stars 71 forks source link

slot_stream_data.connect ("/ kobuki / stream_data") sigslot connection failure #30

Closed hanxia312 closed 4 years ago

hanxia312 commented 7 years ago

Very anxious a problem, I have been debugging for a long time has not been resolved, hoping to get help. Call slot_stream_data.connect ("/ kobuki / stream_data") in simple_loop.cpp; there is a problem with sigslot connection failure. Name: / kobuki / stream_data

Subscribers: 1

# Publishers: 0

Correct should be: Name: / kobuki / stream_data

Subscribers: 1

# Publishers: 1

I do not know where there is a problem, ask for help, thank you, thank you

stonier commented 7 years ago

Taking the simple loop program here and throwing in a ecl::SigSlotsManager<>::printStatistics(); at the end of the constructor I get:

Topics
  Name: /kobuki/controller_info
    # Subscribers: 0
    # Publishers : 1
  Name: /kobuki/stream_data
    # Subscribers: 1
    # Publishers : 1

Possible problems:

  1. You're not calling kobuki.init(parameters) anywhere
  2. The parameters are invalid (init will return with an exception, see here)
hanxia312 commented 7 years ago

I'm going crazy, when i'm in kobuki.cpp Kobuki :: init (Parameters & parameters) { ... Thread.start (& Kobuki :: spin, * this); Ecl :: SigSlotsManager <> :: printStatistics (); } The print value is: Topics Name: / kobuki / controller_info

Subscribers: 0

# Publishers: 1

Name: / kobuki / stream_data

Subscribers: 0

# Publishers: 1

But when i am in simple_loop.cpp

Kobuki.init (parameters); ecl :: SigSlotsManager <> :: printStatistics (); prints the result: Topics

The parameters are valid in kobuki.cpp, but in simple_loop.cpp call Kobuki.init(parameters) function, Topics did not print. Looking forward to your reply, thank you By the way, this kobuki project is my cross compiler arm so library running on the development board. Cross-compilation steps: cd ~ / kobuki_core export PATH = ~ / kobuki_core / src / catkin / bin /: $ {PATH} catkin_make -DCMAKE_TOOLCHAIN_FILE = ~ / kobuki_core / src / catkin / catkin.toolchain.cmake cd build;make install

catkin.toolchain.cmake: SET (CMAKE_SYSTEM_NAME Linux) SET (CMAKE_C_COMPILER "/ usr / bin / my-ndk-toolchain / bin / arm-linux-androideabi-gcc") SET (CMAKE_CXX_COMPILER "/ usr / bin / my-ndk-toolchain / bin / arm-linux-androideabi-g ++") SET (CMAKE_FIND_ROOT_PATH "/ usr / bin / my-ndk-toolchain / sysroot /")

stonier commented 7 years ago

Try without the cross compiler. This shouldn't have any relation, but first thing to do when you have a problem that has no immediate leads - simplify what you are doing until something comes up.

Which branches of ecl and kobuki are you using?

hanxia312 commented 7 years ago

thank you very much for your reply! without cross compile and run simple_loop.cpp this project is successful. How do I run this project using cross compilation? Is there a problem with my cross-compilation steps? Ecl and kobuk's branch is downloaded at : http://yujinrobot.github.io/kobuki/doxygen/enInstallationLinuxGuide.html

https://raw.githubusercontent.com/yujinrobot/kobuki_core/hydro/kobuki_core.rosinstall

Kobuki Core / Yujin stacks

stonier commented 7 years ago

Ach, pretty old sources. Yujin hasn't had anyone updating those...

All of those libraries are very stable, but there has been a few bugfixes over the years...I'd try the latest releases (used in ROS kinetic):

Looks like you're using the ndk cross compiler - making an android app based on the c++ lib? I think you're the first to try that I know of. Another company made a very simple java driver at one point but this should be better if it works. At any rate, it looks like sigslot publishers are not working for some reason. These are not rocket science though, but it might be that the NDK is having trouble with some of the template programming.

Can you create a very simple program that creates a signal and prints the statistics? Verify that it works on the non-cross compile and that it fails on the cross-compile. Then we can dig further there. I'd like to reproduce it here, but I don't have all of the infra/know how to get that running and to test it.

stonier commented 7 years ago

That rosinstall has been updated... https://raw.githubusercontent.com/yujinrobot/kobuki_core/devel/kobuki_core.rosinstall

stonier commented 4 years ago

Original problem has been resolved earlier in the thread.