Closed NikolausDemmel closed 10 years ago
If directly referencing protobuf is the right thing, then I guess dependency entries in package.xml
are needed.
Protobuf is a transitive dependency for kobuki_gazebo_plugins
(i.e. it doesn't use them directly) so I expect the correct solution is that gazebo's pkgconfig should export them.
Closing this, but reopen it if you have problems getting gazebo fixed to export them correctly or some other information comes to light.
Tbh, I don't care enough to research this more, sorry. I'm not using this package myself and only was helping this guy on ros answers.
I opened a ticket this ticket over at gazebo: https://bitbucket.org/osrf/gazebo/issue/1202
@NikolausDemmel thx for your contribution. You are probably right with the addition of ${GAZEBO_LIBRARIES}
. Will look into this, once I have time.
Thank you.
Gazebo developer here; thanks for the bug report. Until we fix the pkg-config file, I believe our cmake config file exports the protobuf dependency properly, so you should be able to use find_package(gazebo)
instead.
@NikolausDemmel thx for your contribution. You are probably right with the addition of ${GAZEBO_LIBRARIES}. Will look into this, once I have time.
Without crawling the headers to check for sure, I dont think this is truly necessary. We've linked and run the plugin without the gazebo libraries and if you run ldd
on the library it doesn't show up, so it hasn't even been accidentally included as a transitive dependency.
The headers though are necessary for include_directories
.
Gazebo developer here; thanks for the bug report. Until we fix the pkg-config file, I believe our cmake config file exports the protobuf dependency properly, so you should be able to use
find_package(gazebo)
instead.
Yeah, that will be easier if it has cmake support now. Thanks for the heads up @scpeters.
@scpeters: Does 1.9.5 provide a cmake module?
Without crawling the headers to check for sure, I dont think this is truly necessary. We've linked and run the plugin without the gazebo libraries and if you run
ldd
on the library it doesn't show up, so it hasn't even been accidentally included as a transitive dependency.
When I don't link in neither gazebo nor protobuf (i.e. without this patch), I get:
Linking CXX shared library /Users/demmeln/work/test-ws/devel/lib/libgazebo_ros_kobuki.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:
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > sdf::Element::Get<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 gazebo_ros_kobuki.cpp.o
bool sdf::Element::Get<bool>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in gazebo_ros_kobuki.cpp.o
double sdf::Element::Get<double>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in gazebo_ros_kobuki.cpp.o
bool sdf::Param::Get<double>(double&) in gazebo_ros_kobuki.cpp.o
bool sdf::Param::Get<bool>(bool&) in gazebo_ros_kobuki.cpp.o
bool sdf::Param::Get<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> >&) in gazebo_ros_kobuki.cpp.o
"sdf::Console::Instance()", referenced from:
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > sdf::Element::Get<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 gazebo_ros_kobuki.cpp.o
bool sdf::Element::Get<bool>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in gazebo_ros_kobuki.cpp.o
double sdf::Element::Get<double>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in gazebo_ros_kobuki.cpp.o
bool sdf::Param::Get<double>(double&) in gazebo_ros_kobuki.cpp.o
sdf::Console::ConsoleStream& sdf::Console::ConsoleStream::operator<<<char [30]>(char const (&) [30]) in gazebo_ros_kobuki.cpp.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 gazebo_ros_kobuki.cpp.o
sdf::Console::ConsoleStream& sdf::Console::ConsoleStream::operator<<<char [3]>(char const (&) [3]) in gazebo_ros_kobuki.cpp.o
...
"sdf::Element::GetElement(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
gazebo::GazeboRosKobuki::Load(boost::shared_ptr<gazebo::physics::Model>, boost::shared_ptr<sdf::Element>) in gazebo_ros_kobuki.cpp.o
"sdf::Element::GetAttribute(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > sdf::Element::Get<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 gazebo_ros_kobuki.cpp.o
bool sdf::Element::Get<bool>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in gazebo_ros_kobuki.cpp.o
double sdf::Element::Get<double>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in gazebo_ros_kobuki.cpp.o
"sdf::Element::HasElementDescription(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > sdf::Element::Get<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 gazebo_ros_kobuki.cpp.o
bool sdf::Element::Get<bool>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in gazebo_ros_kobuki.cpp.o
double sdf::Element::Get<double>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in gazebo_ros_kobuki.cpp.o
"gazebo::math::Quaternion::GetYaw()", referenced from:
gazebo::GazeboRosKobuki::OnUpdate() in gazebo_ros_kobuki.cpp.o
"gazebo::math::Quaternion::~Quaternion()", referenced from:
gazebo::GazeboRosKobuki::OnUpdate() in gazebo_ros_kobuki.cpp.o
"gazebo::math::Pose::Pose(gazebo::math::Pose const&)", referenced from:
gazebo::GazeboRosKobuki::OnUpdate() in gazebo_ros_kobuki.cpp.o
"gazebo::math::Pose::~Pose()", referenced from:
gazebo::GazeboRosKobuki::OnUpdate() in gazebo_ros_kobuki.cpp.o
"gazebo::math::Angle::~Angle()", referenced from:
gazebo::GazeboRosKobuki::OnUpdate() in gazebo_ros_kobuki.cpp.o
"gazebo::math::Vector3::Vector3()", referenced from:
gazebo::GazeboRosKobuki::GazeboRosKobuki() in gazebo_ros_kobuki.cpp.o
"gazebo::math::Vector3::~Vector3()", referenced from:
gazebo::GazeboRosKobuki::GazeboRosKobuki() in gazebo_ros_kobuki.cpp.o
gazebo::GazeboRosKobuki::~GazeboRosKobuki() in gazebo_ros_kobuki.cpp.o
gazebo::GazeboRosKobuki::OnUpdate() in gazebo_ros_kobuki.cpp.o
"gazebo::math::Vector3::operator=(gazebo::math::Vector3 const&)", referenced from:
gazebo::GazeboRosKobuki::OnUpdate() in gazebo_ros_kobuki.cpp.o
"gazebo::msgs::Contacts::CopyFrom(gazebo::msgs::Contacts const&)", referenced from:
gazebo::msgs::Contacts::operator=(gazebo::msgs::Contacts const&) in gazebo_ros_kobuki.cpp.o
"gazebo::msgs::Contacts::Contacts()", referenced from:
gazebo::GazeboRosKobuki::OnUpdate() in gazebo_ros_kobuki.cpp.o
"gazebo::msgs::Contacts::~Contacts()", referenced from:
gazebo::GazeboRosKobuki::OnUpdate() in gazebo_ros_kobuki.cpp.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 gazebo_ros_kobuki.cpp.o
"gazebo::event::Connection::~Connection()", referenced from:
void boost::checked_delete<gazebo::event::Connection>(gazebo::event::Connection*) in gazebo_ros_kobuki.cpp.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::GazeboRosKobuki>, boost::_bi::list1<boost::_bi::value<gazebo::GazeboRosKobuki*> > > >(boost::_bi::bind_t<void, boost::_mfi::mf0<void, gazebo::GazeboRosKobuki>, boost::_bi::list1<boost::_bi::value<gazebo::GazeboRosKobuki*> > >) in gazebo_ros_kobuki.cpp.o
"gazebo::common::Time::Time()", referenced from:
gazebo::GazeboRosKobuki::GazeboRosKobuki() in gazebo_ros_kobuki.cpp.o
"gazebo::common::Time::~Time()", referenced from:
gazebo::GazeboRosKobuki::GazeboRosKobuki() in gazebo_ros_kobuki.cpp.o
gazebo::GazeboRosKobuki::~GazeboRosKobuki() in gazebo_ros_kobuki.cpp.o
gazebo::GazeboRosKobuki::Load(boost::shared_ptr<gazebo::physics::Model>, boost::shared_ptr<sdf::Element>) in gazebo_ros_kobuki.cpp.o
gazebo::GazeboRosKobuki::cmdVelCB(boost::shared_ptr<geometry_msgs::Twist_<std::__1::allocator<void> > const> const&) in gazebo_ros_kobuki.cpp.o
gazebo::GazeboRosKobuki::OnUpdate() in gazebo_ros_kobuki.cpp.o
"gazebo::common::Time::operator=(gazebo::common::Time const&)", referenced from:
gazebo::GazeboRosKobuki::Load(boost::shared_ptr<gazebo::physics::Model>, boost::shared_ptr<sdf::Element>) in gazebo_ros_kobuki.cpp.o
gazebo::GazeboRosKobuki::cmdVelCB(boost::shared_ptr<geometry_msgs::Twist_<std::__1::allocator<void> > const> const&) in gazebo_ros_kobuki.cpp.o
gazebo::GazeboRosKobuki::OnUpdate() in gazebo_ros_kobuki.cpp.o
"gazebo::common::Console::ColorMsg(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int)", referenced from:
gazebo::GazeboRosKobuki::Load(boost::shared_ptr<gazebo::physics::Model>, boost::shared_ptr<sdf::Element>) in gazebo_ros_kobuki.cpp.o
"gazebo::common::Console::Console()", referenced from:
SingletonT<gazebo::common::Console>::GetInstance() in gazebo_ros_kobuki.cpp.o
"gazebo::common::Console::~Console()", referenced from:
SingletonT<gazebo::common::Console>::GetInstance() in gazebo_ros_kobuki.cpp.o
"gazebo::physics::Model::GetJoint(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
gazebo::GazeboRosKobuki::Load(boost::shared_ptr<gazebo::physics::Model>, boost::shared_ptr<sdf::Element>) in gazebo_ros_kobuki.cpp.o
"gazebo::sensors::SensorManager::SensorManager()", referenced from:
SingletonT<gazebo::sensors::SensorManager>::GetInstance() in gazebo_ros_kobuki.cpp.o
"gazebo::sensors::SensorManager::~SensorManager()", referenced from:
SingletonT<gazebo::sensors::SensorManager>::GetInstance() in gazebo_ros_kobuki.cpp.o
"gazebo::sensors::RaySensor::GetRange(int)", referenced from:
gazebo::GazeboRosKobuki::OnUpdate() in gazebo_ros_kobuki.cpp.o
"google::protobuf::internal::LogMessage::LogMessage(google::protobuf::LogLevel, char const*, int)", referenced from:
google::protobuf::RepeatedPtrField<gazebo::msgs::Vector3d>::TypeHandler::Type const& google::protobuf::internal::RepeatedPtrFieldBase::Get<google::protobuf::RepeatedPtrField<gazebo::msgs::Vector3d>::TypeHandler>(int) const in gazebo_ros_kobuki.cpp.o
google::protobuf::RepeatedPtrField<gazebo::msgs::Contact>::TypeHandler::Type const& google::protobuf::internal::RepeatedPtrFieldBase::Get<google::protobuf::RepeatedPtrField<gazebo::msgs::Contact>::TypeHandler>(int) const in gazebo_ros_kobuki.cpp.o
"google::protobuf::internal::LogMessage::~LogMessage()", referenced from:
google::protobuf::RepeatedPtrField<gazebo::msgs::Vector3d>::TypeHandler::Type const& google::protobuf::internal::RepeatedPtrFieldBase::Get<google::protobuf::RepeatedPtrField<gazebo::msgs::Vector3d>::TypeHandler>(int) const in gazebo_ros_kobuki.cpp.o
google::protobuf::RepeatedPtrField<gazebo::msgs::Contact>::TypeHandler::Type const& google::protobuf::internal::RepeatedPtrFieldBase::Get<google::protobuf::RepeatedPtrField<gazebo::msgs::Contact>::TypeHandler>(int) const in gazebo_ros_kobuki.cpp.o
"google::protobuf::internal::LogMessage::operator<<(char const*)", referenced from:
google::protobuf::RepeatedPtrField<gazebo::msgs::Vector3d>::TypeHandler::Type const& google::protobuf::internal::RepeatedPtrFieldBase::Get<google::protobuf::RepeatedPtrField<gazebo::msgs::Vector3d>::TypeHandler>(int) const in gazebo_ros_kobuki.cpp.o
google::protobuf::RepeatedPtrField<gazebo::msgs::Contact>::TypeHandler::Type const& google::protobuf::internal::RepeatedPtrFieldBase::Get<google::protobuf::RepeatedPtrField<gazebo::msgs::Contact>::TypeHandler>(int) const in gazebo_ros_kobuki.cpp.o
"google::protobuf::internal::LogFinisher::operator=(google::protobuf::internal::LogMessage&)", referenced from:
google::protobuf::RepeatedPtrField<gazebo::msgs::Vector3d>::TypeHandler::Type const& google::protobuf::internal::RepeatedPtrFieldBase::Get<google::protobuf::RepeatedPtrField<gazebo::msgs::Vector3d>::TypeHandler>(int) const in gazebo_ros_kobuki.cpp.o
google::protobuf::RepeatedPtrField<gazebo::msgs::Contact>::TypeHandler::Type const& google::protobuf::internal::RepeatedPtrFieldBase::Get<google::protobuf::RepeatedPtrField<gazebo::msgs::Contact>::TypeHandler>(int) const in gazebo_ros_kobuki.cpp.o
"sdf::Element::HasElement(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const", referenced from:
gazebo::GazeboRosKobuki::Load(boost::shared_ptr<gazebo::physics::Model>, boost::shared_ptr<sdf::Element>) in gazebo_ros_kobuki.cpp.o
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > sdf::Element::Get<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 gazebo_ros_kobuki.cpp.o
bool sdf::Element::Get<bool>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in gazebo_ros_kobuki.cpp.o
double sdf::Element::Get<double>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in gazebo_ros_kobuki.cpp.o
"sdf::Element::GetElementImpl(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const", referenced from:
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > sdf::Element::Get<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 gazebo_ros_kobuki.cpp.o
bool sdf::Element::Get<bool>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in gazebo_ros_kobuki.cpp.o
double sdf::Element::Get<double>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in gazebo_ros_kobuki.cpp.o
"sdf::Element::GetElementDescription(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const", referenced from:
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > sdf::Element::Get<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 gazebo_ros_kobuki.cpp.o
bool sdf::Element::Get<bool>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in gazebo_ros_kobuki.cpp.o
double sdf::Element::Get<double>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in gazebo_ros_kobuki.cpp.o
"sdf::Element::GetParent() const", referenced from:
gazebo::GazeboRosKobuki::Load(boost::shared_ptr<gazebo::physics::Model>, boost::shared_ptr<sdf::Element>) in gazebo_ros_kobuki.cpp.o
"gazebo::math::Angle::Radian() const", referenced from:
gazebo::GazeboRosKobuki::OnUpdate() in gazebo_ros_kobuki.cpp.o
"gazebo::common::Time::Double() const", referenced from:
gazebo::GazeboRosKobuki::OnUpdate() in gazebo_ros_kobuki.cpp.o
"gazebo::common::Time::operator-(gazebo::common::Time const&) const", referenced from:
gazebo::GazeboRosKobuki::OnUpdate() in gazebo_ros_kobuki.cpp.o
"gazebo::physics::Base::GetWorld() const", referenced from:
gazebo::GazeboRosKobuki::Load(boost::shared_ptr<gazebo::physics::Model>, boost::shared_ptr<sdf::Element>) in gazebo_ros_kobuki.cpp.o
"gazebo::physics::Joint::GetAngle(int) const", referenced from:
gazebo::GazeboRosKobuki::OnUpdate() in gazebo_ros_kobuki.cpp.o
"gazebo::physics::World::GetSimTime() const", referenced from:
gazebo::GazeboRosKobuki::Load(boost::shared_ptr<gazebo::physics::Model>, boost::shared_ptr<sdf::Element>) in gazebo_ros_kobuki.cpp.o
gazebo::GazeboRosKobuki::cmdVelCB(boost::shared_ptr<geometry_msgs::Twist_<std::__1::allocator<void> > const> const&) in gazebo_ros_kobuki.cpp.o
gazebo::GazeboRosKobuki::OnUpdate() in gazebo_ros_kobuki.cpp.o
"gazebo::sensors::ContactSensor::GetContacts() const", referenced from:
gazebo::GazeboRosKobuki::OnUpdate() in gazebo_ros_kobuki.cpp.o
"gazebo::sensors::SensorManager::GetSensor(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const", referenced from:
gazebo::GazeboRosKobuki::Load(boost::shared_ptr<gazebo::physics::Model>, boost::shared_ptr<sdf::Element>) in gazebo_ros_kobuki.cpp.o
"gazebo::sensors::ImuSensor::GetOrientation() const", referenced from:
gazebo::GazeboRosKobuki::OnUpdate() in gazebo_ros_kobuki.cpp.o
"gazebo::sensors::ImuSensor::GetAngularVelocity() const", referenced from:
gazebo::GazeboRosKobuki::OnUpdate() in gazebo_ros_kobuki.cpp.o
"gazebo::sensors::ImuSensor::GetLinearAcceleration() const", referenced from:
gazebo::GazeboRosKobuki::OnUpdate() in gazebo_ros_kobuki.cpp.o
"typeinfo for gazebo::sensors::ContactSensor", referenced from:
boost::shared_ptr<gazebo::sensors::ContactSensor> boost::dynamic_pointer_cast<gazebo::sensors::ContactSensor, gazebo::sensors::Sensor>(boost::shared_ptr<gazebo::sensors::Sensor> const&) in gazebo_ros_kobuki.cpp.o
"typeinfo for gazebo::sensors::Sensor", referenced from:
boost::shared_ptr<gazebo::sensors::RaySensor> boost::dynamic_pointer_cast<gazebo::sensors::RaySensor, gazebo::sensors::Sensor>(boost::shared_ptr<gazebo::sensors::Sensor> const&) in gazebo_ros_kobuki.cpp.o
boost::shared_ptr<gazebo::sensors::ContactSensor> boost::dynamic_pointer_cast<gazebo::sensors::ContactSensor, gazebo::sensors::Sensor>(boost::shared_ptr<gazebo::sensors::Sensor> const&) in gazebo_ros_kobuki.cpp.o
boost::shared_ptr<gazebo::sensors::ImuSensor> boost::dynamic_pointer_cast<gazebo::sensors::ImuSensor, gazebo::sensors::Sensor>(boost::shared_ptr<gazebo::sensors::Sensor> const&) in gazebo_ros_kobuki.cpp.o
"typeinfo for gazebo::sensors::ImuSensor", referenced from:
boost::shared_ptr<gazebo::sensors::ImuSensor> boost::dynamic_pointer_cast<gazebo::sensors::ImuSensor, gazebo::sensors::Sensor>(boost::shared_ptr<gazebo::sensors::Sensor> const&) in gazebo_ros_kobuki.cpp.o
"typeinfo for gazebo::sensors::RaySensor", referenced from:
boost::shared_ptr<gazebo::sensors::RaySensor> boost::dynamic_pointer_cast<gazebo::sensors::RaySensor, gazebo::sensors::Sensor>(boost::shared_ptr<gazebo::sensors::Sensor> const&) in gazebo_ros_kobuki.cpp.o
@NikolausDemmel yes, version 1.9.5 has a cmake configuration file.
@scpeters: Ah yes; I was looking for the wrong file and earlier the find_package(gazebo)
did not seem to work, now it does, thanks.
I changed the PR to use find_package(gazebo)
. Briefly tested on OS X 10.9 and it compiles.
Works fine. Merging.
Thanks @NikolausDemmel
Thank you.