Ich bin neu in ROS und Gazebo Programmierung. Ich versuche ein Steuerungs-Plugin für den Laser zu erstellen, den ich an meinem Robotermodell montiert habe.Gazebo Ros Plugin Fehler machen: Undefinierte Symbole für die Architektur x86_64
Ich bin mit ROS indigo und Pavillon 7.0 auf MAC OS X 10.11.5
Mein Problem kommt, wenn ich zu kompilieren versuchen, unter Verwendung von Standard 'Cmake' und 'make', die .cc Datei meiner Plugin .
ein offizielles Tutorial verfolgt (http://gazebosim.org/tutorials/?tut=plugins_model) habe ich schrieb die CMakeLists.txt wie:
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})
Ich denke, dass das Problem aus den Bibliotheken Abhängigkeiten ableiten könnte.
Der Befehl ‚cmake‘ scheint zwar gut zu arbeiten ‚make‘ zurückzukehren folgende Ausgabe:
[ 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
Kann mir jemand helfen?
Danke,
Pietro