Я новичок в программировании ROS и Gazebo. Я пытаюсь создать плагин управления для лазера, который я установил на моей модели робота.gazebo ros plugin make error: Неопределенные символы для архитектуры x86_64
Я использую ROS индиго и беседку 7.0 на MAC OS X 10.11.5
Моя проблема возникает, когда я пытаюсь скомпилировать, используя стандарт «CMake» и «Make», то .cc файл моего плагина ,
После официального учебника (http://gazebosim.org/tutorials/?tut=plugins_model), я написал CMakeLists.txt как:
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
find_package(roscpp REQUIRED)
find_package(std_msgs REQUIRED)
include_directories(${roscpp_INCLUDE_DIRS})
include_directories(${std_msgs_INCLUDE_DIRS})
# Find Gazebo
find_package(gazebo REQUIRED)
include_directories(${GAZEBO_INCLUDE_DIRS})
link_directories(${GAZEBO_LIBRARY_DIRS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GAZEBO_CXX_FLAGS}")
# Build our plugin
add_library(velodyne_plugin SHARED velodyne_plugin.cc)
target_link_libraries(velodyne_plugin ${GAZEBO_libraries} ${catkin_LIBRARIES} ${Boost_LIBRARIES} ${roscpp_LIBRARIES})
Я думаю, что эта проблема может вывести из зависимостей в библиотеках.
Команда «CMake», кажется, хорошо, а работать «сделать» вернуть следующий вывод:
[ 50%] Linking CXX shared library libvelodyne_plugin.dylib
Undefined symbols for architecture x86_64:
"sdf::Console::ColorMsg(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned int, int)", referenced from:
double sdf::Element::Get<double>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in velodyne_plugin.cc.o
bool sdf::Param::Get<double>(double&) const in velodyne_plugin.cc.o
"sdf::Console::Instance()", referenced from:
double sdf::Element::Get<double>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in velodyne_plugin.cc.o
bool sdf::Param::Get<double>(double&) const in velodyne_plugin.cc.o
sdf::Console::ConsoleStream& sdf::Console::ConsoleStream::operator<<<char [30]>(char const (&) [30]) in velodyne_plugin.cc.o
sdf::Console::ConsoleStream& sdf::Console::ConsoleStream::operator<<<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in velodyne_plugin.cc.o
sdf::Console::ConsoleStream& sdf::Console::ConsoleStream::operator<<<char [3]>(char const (&) [3]) in velodyne_plugin.cc.o
sdf::Console::ConsoleStream& sdf::Console::ConsoleStream::operator<<<char [29]>(char const (&) [29]) in velodyne_plugin.cc.o
sdf::Console::ConsoleStream& sdf::Console::ConsoleStream::operator<<<char [15]>(char const (&) [15]) in velodyne_plugin.cc.o
...
"sdf::Element::GetElement(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
gazebo::VelodynePlugin::Load(boost::shared_ptr<gazebo::physics::Model>, std::__1::shared_ptr<sdf::Element>) in velodyne_plugin.cc.o
"sdf::Element::GetAttribute(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
double sdf::Element::Get<double>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in velodyne_plugin.cc.o
"sdf::Element::HasElementDescription(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
double sdf::Element::Get<double>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in velodyne_plugin.cc.o
"gazebo::event::Connection::Connection(gazebo::event::Event*, int)", referenced from:
gazebo::event::EventT<void (gazebo::common::UpdateInfo const&)>::Connect(boost::function<void (gazebo::common::UpdateInfo const&)> const&) in velodyne_plugin.cc.o
"gazebo::event::Connection::~Connection()", referenced from:
void boost::checked_delete<gazebo::event::Connection>(gazebo::event::Connection*) in velodyne_plugin.cc.o
"gazebo::event::Events::worldUpdateBegin", referenced from:
boost::shared_ptr<gazebo::event::Connection> gazebo::event::Events::ConnectWorldUpdateBegin<boost::_bi::bind_t<void, boost::_mfi::mf0<void, gazebo::VelodynePlugin>, boost::_bi::list1<boost::_bi::value<gazebo::VelodynePlugin*> > > >(boost::_bi::bind_t<void, boost::_mfi::mf0<void, gazebo::VelodynePlugin>, boost::_bi::list1<boost::_bi::value<gazebo::VelodynePlugin*> > >) in velodyne_plugin.cc.o
"gazebo::common::Time::Time(double)", referenced from:
gazebo::VelodynePlugin::UpdateChild() in velodyne_plugin.cc.o
"gazebo::common::Time::Time()", referenced from:
gazebo::VelodynePlugin::VelodynePlugin() in velodyne_plugin.cc.o
"gazebo::common::Time::~Time()", referenced from:
gazebo::VelodynePlugin::Load(boost::shared_ptr<gazebo::physics::Model>, std::__1::shared_ptr<sdf::Element>) in velodyne_plugin.cc.o
gazebo::VelodynePlugin::~VelodynePlugin() in velodyne_plugin.cc.o
gazebo::VelodynePlugin::UpdateChild() in velodyne_plugin.cc.o
"gazebo::common::Time::operator=(gazebo::common::Time const&)", referenced from:
gazebo::VelodynePlugin::Load(boost::shared_ptr<gazebo::physics::Model>, std::__1::shared_ptr<sdf::Element>) in velodyne_plugin.cc.o
"gazebo::common::Time::operator+=(gazebo::common::Time const&)", referenced from:
gazebo::VelodynePlugin::UpdateChild() in velodyne_plugin.cc.o
"ignition::math::IndexException::IndexException()", referenced from:
ignition::math::Vector3<double>::operator[](unsigned long) const in velodyne_plugin.cc.o
ignition::math::Vector2<int>::operator[](unsigned long) const in velodyne_plugin.cc.o
ignition::math::Vector2<double>::operator[](unsigned long) const in velodyne_plugin.cc.o
"sdf::Element::HasElement(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const", referenced from:
gazebo::VelodynePlugin::Load(boost::shared_ptr<gazebo::physics::Model>, std::__1::shared_ptr<sdf::Element>) in velodyne_plugin.cc.o
double sdf::Element::Get<double>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in velodyne_plugin.cc.o
"sdf::Element::GetElementImpl(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const", referenced from:
double sdf::Element::Get<double>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in velodyne_plugin.cc.o
"sdf::Element::GetElementDescription(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const", referenced from:
double sdf::Element::Get<double>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in velodyne_plugin.cc.o
"gazebo::common::Time::Double() const", referenced from:
gazebo::VelodynePlugin::UpdateChild() in velodyne_plugin.cc.o
"gazebo::common::Time::operator-(gazebo::common::Time const&) const", referenced from:
gazebo::VelodynePlugin::UpdateChild() in velodyne_plugin.cc.o
"gazebo::physics::Base::GetWorld() const", referenced from:
gazebo::VelodynePlugin::Load(boost::shared_ptr<gazebo::physics::Model>, std::__1::shared_ptr<sdf::Element>) in velodyne_plugin.cc.o
"gazebo::physics::Model::GetJointCount() const", referenced from:
gazebo::VelodynePlugin::Load(boost::shared_ptr<gazebo::physics::Model>, std::__1::shared_ptr<sdf::Element>) in velodyne_plugin.cc.o
"gazebo::physics::Model::GetJoints() const", referenced from:
gazebo::VelodynePlugin::Load(boost::shared_ptr<gazebo::physics::Model>, std::__1::shared_ptr<sdf::Element>) in velodyne_plugin.cc.o
"gazebo::physics::World::GetSimTime() const", referenced from:
gazebo::VelodynePlugin::Load(boost::shared_ptr<gazebo::physics::Model>, std::__1::shared_ptr<sdf::Element>) in velodyne_plugin.cc.o
gazebo::VelodynePlugin::UpdateChild() in velodyne_plugin.cc.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [libvelodyne_plugin.dylib] Error 1
make[1]: *** [CMakeFiles/velodyne_plugin.dir/all] Error 2
make: *** [all] Error 2
Может кто-нибудь мне помочь?
Спасибо,
Pietro