ApolloAuto / apollo-platform

Collections of Apollo Platform Software
736 stars 389 forks source link

Run roscore error after build in Ubuntu 16.04 #57

Closed echotor closed 6 years ago

echotor commented 6 years ago

I build the apollo-platform in Ubuntu 16.04, and it passed. But when I run roscore, it outputs the error like below:

Traceback (most recent call last):
  File "/home/apollo/Apollo/apollo-platform/install_isolated/bin/rosmaster", line 34, in <module>
    import rosmaster
  File "/home/apollo/Apollo/apollo-platform/install_isolated/lib/python2.7/dist-packages/rosmaster/__init__.py", line 35, in <module>
    from .main import rosmaster_main
  File "/home/apollo/Apollo/apollo-platform/install_isolated/lib/python2.7/dist-packages/rosmaster/main.py", line 43, in <module>
    import rosmaster.master
  File "/home/apollo/Apollo/apollo-platform/install_isolated/lib/python2.7/dist-packages/rosmaster/master.py", line 45, in <module>
    import rosgraph.xmlrpc
  File "/home/apollo/Apollo/apollo-platform/install_isolated/lib/python2.7/dist-packages/rosgraph/__init__.py", line 36, in <module>
    from . masterapi import Master, MasterFailure, MasterError, MasterException
  File "/home/apollo/Apollo/apollo-platform/install_isolated/lib/python2.7/dist-packages/rosgraph/masterapi.py", line 49, in <module>
    from rospy.impl.broadcast_manager import BroadcastManager
  File "/home/apollo/Apollo/apollo-platform/install_isolated/lib/python2.7/dist-packages/rospy/__init__.py", line 49, in <module>
    from .client import spin, myargv, init_node, \
  File "/home/apollo/Apollo/apollo-platform/install_isolated/lib/python2.7/dist-packages/rospy/client.py", line 60, in <module>
    import rospy.impl.init
  File "/home/apollo/Apollo/apollo-platform/install_isolated/lib/python2.7/dist-packages/rospy/impl/init.py", line 54, in <module>
    from .tcpros import init_tcpros
  File "/home/apollo/Apollo/apollo-platform/install_isolated/lib/python2.7/dist-packages/rospy/impl/tcpros.py", line 45, in <module>
    import rospy.impl.tcpros_service
  File "/home/apollo/Apollo/apollo-platform/install_isolated/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 65, in <module>
    from broadcast_manager import BroadcastManager
  File "/home/apollo/Apollo/apollo-platform/install_isolated/lib/python2.7/dist-packages/rospy/impl/broadcast_manager.py", line 58, in <module>
    from rospy.impl import participant
  File "/home/apollo/Apollo/apollo-platform/install_isolated/lib/python2.7/dist-packages/rospy/impl/participant.py", line 28, in <module>
    _participant = swig_import_helper()
  File "/home/apollo/Apollo/apollo-platform/install_isolated/lib/python2.7/dist-packages/rospy/impl/participant.py", line 20, in swig_import_helper
    import _participant
ImportError: /home/apollo/Apollo/apollo-platform/install_isolated/lib/_participant.so: undefined symbol: _ZN3ros11Participant8read_msgEv

Should I solve this problem? I find the issue like https://github.com/ApolloAuto/apollo-platform/issues/52 https://github.com/ApolloAuto/apollo-platform/issues/19 But I can not find a solution for this.

echotor commented 6 years ago

I solve the problem:

  1. build and install fast-rtps follow the build.sh in https://github.com/ApolloAuto/apollo-platform/blob/master/ros/third_party/build.sh
  2. build and install the apollo-platform
  3. build and install _participant.so follow the build.sh in https://github.com/ApolloAuto/apollo-platform/blob/master/ros/third_party/swig_wrapper/build.sh

Then the apollo-platform is built in ubuntu 16.04 successfully.

wlwu92 commented 6 years ago

Hi, have you build apollo-ros in ubuntu 16.04 correctly? I also caught the same error, and follow your hint I fixed the error, but I caught another error as follow when I run any ros command.

terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
Aborted (core dumped)
echotor commented 6 years ago

NO, I can run correctly. @wlwu92

gengqx commented 6 years ago

@wlwu92 Have you solve the problem? I have teh same error.

gengqx commented 6 years ago

@echotor Could you push your Ros source folder to your githbub?

echotor commented 6 years ago

@gengqx Hi, the solve method is:

  1. build and install fast-rtps follow the build.sh in https://github.com/ApolloAuto/apollo-platform/blob/master/ros/third_party/build.sh
  2. build and install the apollo-platform
  3. build and install _participant.so follow the build.sh in https://github.com/ApolloAuto/apollo-platform/blob/master/ros/third_party/swig_wrapper/build.sh