In GDB, I see "SIGSEGV" signal received and then the following output
0x00000000004603e0 in typeinfo for boost::io::basic_altstringbuf, std::allocator> ()
A node handle is declared elsewhere and set via an accessor in the class where this crash is occuring. The code leading up to the line where crash occurs is creating a publisher object using that node handle. Once the publisher is created, a function is called and passed that publisher object by reference
Logging statements before the function call that is crashing show that the all the objects involved appear to be valid.
Any hints/ideas what this error means or how to debug this?
↧
Node crashing with typeinfo for boost:io:basic_altstringbuf error
↧
64 bit catkin/ boost issue
I have a new ubuntu 64 bit 14.04 upgrade and a project which used to build successfully with catkin_make. Now I'm getting
make[2]: *** No rule to make target `/usr/lib/libboost_regex-mt.so', needed by ... < one of my source files>
I've re-installed ros/indigo
Any ideas? (thanks in advance)
↧
↧
Boost::Thread and ROS Fuerte CMake help
Ok, so I am trying to utilize boost threads in a ROS application and I have been trying to figure out how to link boost to the the final exe. I keep finding conflicting ways on how to do this and not sure if i am doing it right.
This is my CMake file:
cmake_minimum_required(VERSION 2.4.6)
include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)
# Set the build type. Options are:
# Coverage : w/ debug symbols, w/o optimization, w/ code-coverage
# Debug : w/ debug symbols, w/o optimization
# Release : w/o debug symbols, w/ optimization
# RelWithDebInfo : w/ debug symbols, w/ optimization
# MinSizeRel : w/o debug symbols, w/ optimization, stripped binaries
#set(ROS_BUILD_TYPE RelWithDebInfo)
rosbuild_init()
#set the default path for built executables to the "bin" directory
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
#set the default path for built libraries to the "lib" directory
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
find_package(Boost REQUIRED COMPONENTS thread)
rosbuild_add_boost_directories()
#uncomment if you have defined messages
#rosbuild_genmsg()
#uncomment if you have defined services
#rosbuild_gensrv()
#common commands for building c++ executables and libraries
rosbuild_add_library(Joystick src/CJoystick.cpp)
rosbuild_add_library(Frame src/CFrame.cpp)
rosbuild_add_library(Control src/CControl.cpp)
rosbuild_add_library(Vec2 src/Classes/Vec2/Vec2.cpp)
rosbuild_add_library(Vec3 src/Classes/Vec3/vec3.cpp)
rosbuild_add_library(Vec4 src/Classes/Vec4/Vec4.cpp)
rosbuild_add_library(Mat3 src/Classes/Mat3/mat3.cpp)
rosbuild_add_library(Waypoint src/Classes/Waypoint/waypoint.cpp)
rosbuild_add_library(UAV src/Classes/UAV/UAV.cpp)
#rosbuild_add_library(ARDrone src/ARDrone.cpp)
rosbuild_add_executable(ARDroneV4 src/ARDrone.cpp)
target_link_libraries(ARDroneV4 UAV Waypoint Frame Control Mat3 Vec2 Vec3 Vec4 Joystick)
rosbuild_link_boost(ARDroneV4 thread system)
Though it compiles fine the threading never happens. Any idea on what I am doing wrong?
Update:
This is the basic outline . Everything not associated with the thread is not included.
#include
void workfunc(){
ROS_INFO("New Thread");
}
int main(int argc,char **argv)
{
time_t rawtime;
std::string logfile;
ros::init(argc,argv, "ARDroneControl"); //create node
ros::NodeHandle n;
ros::Rate rate(FREQ); //cycle per seconds
while(n.ok())
{
boost::thread(workfunc);
ros::spinOnce();
rate.sleep();
}
return 0;
}
↧
Boost not found?
I recently upgraded from Ubuntu 12 to 14.04. I also upgraded ROS Groovy to Indigo.
However, when I migrated one of my packages, it could not find boost anymore during compilation :
make[2]: *** No rule to make target `/usr/lib/libboost_thread-mt.so', needed by ...
The compiler does seem to find Boost :
-- Boost version: 1.54.0
-- Found the following Boost libraries:
-- thread
And Boost seems to be properly installed, although without the ***-mt*** part under :
/usr/lib/libboost_thread.so.1.54.0
In my CMakeLists I have the following code regarding Boost :
find_package(Boost REQUIRED COMPONENTS thread)
include_directories(include ${catkin_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})
target_link_libraries(my_node ${Boost_LIBRARIES} ${catkin_LIBRARIES})
The issue look similar to the one posted here : http://answers.ros.org/question/193486/64-bit-catkin-boost-issue/#204049
Thank you for any ideas!
Ruud
PS: My total CMakeLists
cmake_minimum_required(VERSION 2.8.3)
project(visual_servo_control)
find_package(catkin REQUIRED COMPONENTS
tf
roscpp
rospy
std_msgs
message_generation
geometry_msgs
image_transport
)
## Generate messages in the 'msg' folder
add_message_files(
FILES
)
## Generate services in the 'srv' folder
add_service_files(
FILES
request_servo_velocity_vector.srv
)
## Generate added messages and services with any dependencies listed here
generate_messages(
DEPENDENCIES
std_msgs
)
catkin_package(
# INCLUDE_DIRS include
# LIBRARIES hdev_engine
CATKIN_DEPENDS roscpp rospy std_msgs
# DEPENDS system_lib
)
## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(${catkin_INCLUDE_DIRS})
include_directories(include)
## Declare a cpp executable
add_executable(my_node src/my_node.cpp)
## Add cmake target dependencies of the executable/library
## as an example, message headers may need to be generated before nodes
add_dependencies(my_node my_node_generate_messages_cpp)
find_package(Boost REQUIRED COMPONENTS thread)
include_directories(${Boost_INCLUDE_DIRS})
target_link_libraries(my_node ${Boost_LIBRARIES})
find_package(VISP REQUIRED)
include_directories(${VISP_INCLUDE_DIRS})
target_link_libraries(my_node ${VISP_LIBRARIES})
## Specify libraries to link a library or executable target against
target_link_libraries(my_node ${catkin_LIBRARIES})
add_executable(cycle_node src/cycle_node.cpp)
target_link_libraries(cycle_node ${catkin_LIBRARIES})
↧
Undefined symbol ros::Publisher::~Publisher with Boost Python
I have some code written in C++ that I want to wrap using [Boost Python](http://www.boost.org/doc/libs/1_57_0/libs/python/doc/) so that a colleague can use it in an RQT widget. The code is just a few functions in a library and the wrapper code compiles without errors. However, when I try to import the resulting Python module I get:
ImportError: catkin_ws/devel/lib/libGuidance.so:
undefined symbol: _ZN3ros9PublisherD1Ev
which de-mangles to ros::Publisher::~Publisher. I'm confused because none of the functions in the wrapped library (guidance_factory) make any ROS function calls, though they call static methods of a class (Guidance) which has ros::Publisher objects as member variables. The wrapped methods do this without instantiating the class (I didn't wrap the instantiator method of the factory, nor did I wrap the classes) or referencing the Publisher variables directly or indirectly.
I've followed the example at: [ROS/Tutorials/Using a C++ class in Python](http://wiki.ros.org/ROS/Tutorials/Using%20a%20C%2B%2B%20class%20in%20Python) with appropriate name conversions and the wrapper library shows up in catkin_ws/devel/lib/python2.7/dist-packages/wrapper-pkg/guidance_ext.so as expected.
I've determined the following: guidance_ext.so (the python wrapper library) links to libguidance_factory.so (the C++ library being wrapped) which links to libGuidance.so (the parent class of those classes whose static methods are used) as well as all the child class libs. None of these libraries contain the ros::Publisher symbol (expected) or link to libroscpp.so (slightly unexpected). This is apparently not usually a problem because these libraries have only every been run linked from executables/nodes that do link libroscpp.so. My CMakeLists.txt does includes
find_package(catkin REQUIRED COMPONENTS roscpp)
and
target_link_libraries(guidance_ext
guidance_factory
${catkin_LIBRARIES}
${Boost_LIBRARIES}
)
so I would expect roscpp to be linked.
I'm using Indigo on Ubuntu 14.04. The wrapper code is currently in a different package from the library it's wrapping, but the wrapped library is being exported and the wrapper code compiles.
How can I either get the required linkage to work or else convince catkin that I don't need that symbol anyway? Thanks in advance.
↧
↧
Linking with boost 1.57
Hello,
i am using groovy and ubuntu 12.04.
I linked my node with boost 1.55 at the moment, that works fine. Now I have to update to boost 1.57.
CMakeLists.txt
set(Boost_NO_SYSTEM_PATHS TRUE)
set(BOOST_ROOT /opt/boost/boost_1_57)
include_directories(SYSTEM ${Boost_INCLUDE_DIRS}
find_package(Boost 1.57 REQUIRED COMPONENTS thread filesystem log system)
add_executable(test_node src/test.cpp)
if(TARGET test_node)
target_link_libraries(test_node
${catkin_LIBRARIES}
${Boost_LIBRARIES}
)
The problem is that i get no callback if I send a message, with boost 1.55 it worked well. Does someone have some experience with boost 1.57 and ROS?
Or it is possible to build my application as library with boost 1.57 and use it with ROS?
----------------------------------------
UPDATE
My second possibility is to split my build process in two CMakelists
CMakelists1.txt (with ROS)
add_subdirectory(test)
add_executable(test_node src/test.cpp)
target_link_libraries(test_node
${catkin_LIBRARIES}
testApplication
)
CMakelists2.txt (inside test directory , without cmake and ROS)
set(Boost_NO_SYSTEM_PATHS TRUE)
set(BOOST_ROOT /opt/boost/boost_1_57)
include_directories(SYSTEM ${Boost_INCLUDE_DIRS}
find_package(Boost 1.57 REQUIRED COMPONENTS thread filesystem log system)
add_library(testApplication STATIC testApplication.cpp)
if(TARGET testApplication)
target_link_libraries(testApplication
${Boost_LIBRARIES}
)
Something like this, is this possible?
What is your favourite linking there ? Static or SHARED?
↧
Using Boost with roscpp (Catkin errors)
I'm trying to use some boost functions in my C++ ROS code, but running into some frustrating issues with catkin.
In my CMakeLists.txt file, I have the following:
cmake_minimum_required(VERSION 2.8.3)
project(project_name)
find_package(
catkin REQUIRED COMPONENTS
roscpp
rospy
std_msgs
Boost
)
include_directories(
include ${catkin_INCLUDE_DIRS} ${roscpp_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}
)
add_executable(exec_name src/exec_name.cpp)
target_link_libraries(exec_name ${catkin_LIBRARIES})
And I have installed `libboost-all-dev` on my Ubuntu 14.04 machine with `apt-get`. When I try to compile my project, however, I get the following error:
> CMake Error at> /opt/ros/indigo/share/catkin/cmake/catkinConfig.cmake:75> (find_package): Could not find a> package configuration file provided by> "Boost" with any of the following> names:>> BoostConfig.cmake> boost-config.cmake>> Add the installation prefix of> "Boost" to CMAKE_PREFIX_PATH or set > "Boost_DIR" to a directory containing> one of the above files. If "Boost" > provides a separate development> package or SDK, be sure it has been > installed.
I have searched all the files on the machine and cannot find anywhere a file named "BoostConfig.cmake" or "boost-config.cmake", are they something that should be included when I installed Boost through apt-get? If anyone could help me figure out why CMake can't find Boost, it would be hugely appreciated.
↧
Trouble using default Boost libraries.
Hello,
I am having trouble using the priority queue from the default Boost installation with my ros node. Some libraries can be found, and some cannot. I can find the basics like system, thread, and signals, but I cannot find lambda or priority_queue.
Error Message:
CMake Error at /usr/share/cmake-2.8/Modules/FindBoost.cmake:1131 (message):
Unable to find the requested Boost libraries.
Boost version: 1.54.0
Boost include path: /usr/include
Could not find the following Boost libraries:
boost_lambda
boost_heap
Some (but not all) of the required Boost libraries were found. You may
need to install these additional Boost libraries. Alternatively, set
BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT
to the location of Boost.
Call Stack (most recent call first):
CMakeLists.txt:16 (find_package)
My CMakesList.txt. The comments are things that did not work.
#SET (Boost_LIB_PREFIX "")
#SET(BOOST_LIBRARYDIR "/usr/lib/x86_64-linux-gnu")
find_package(Boost REQUIRED COMPONENTS
system
thread
signals
lambda
priority_queue
)
EDIT:
I'm using Ubuntu 14.04.2 LTS and ROS Hydro compiled from source
↧
How to run ros::spin in the background
Hi,
I have a qt application and which has many Callbacks. As I dont have and infinite loop, I can't write ros::spin(). I would like to have ros::spin() or spinonce() in the background. How can i achieve using multi-threading. Any help would be highly appreciated
Thanks,
Arjun
↧
↧
i can't launch karto_slam on ros indigo
Hello all,
I installed karto_slam by sudo apt-get install ros-indigo-slam-karto
but i could not launch it! My launch file is
the out put on the screen is:
> terminate called after throwing an instance of 'boost::exception_detail::clone_impl>'
what(): boost: mutex lock failed in pthread_mutex_lock: Invalid argument
process[rviz-3]: started with pid [3776]
[slam_karto-2] process has died [pid 3732, exit code -6, cmd /opt/ros/indigo/lib/slam_karto/slam_karto scan:=base_scan __name:=slam_karto __log:=/home/z/.ros/log/5d21dfba-15ae-11e5-ada1-b8ee65bb0a99/slam_karto-2.log].
log file: /home/z/.ros/log/5d21dfba-15ae-11e5-ada1-b8ee65bb0a99/slam_karto-2*.log
However the log file is empty!
any one face the same problem? It seems somethings with boost version! if yes so how i can resolve it?
Than you in advance
↧
ros service call kills node and throws boost::thread_interrupted
Hi
I am trying to write a simple ros service. When I call the service from the command line, it works perfectly fine.But when I call the service from my code (either from a member function or directly from main, same result), I get random node crashes (of the calling node) when the service is called. The error thrown is
terminate called after throwing an exception of 'boost::thread_interrupted'
I tried putting tests before calling the service such as
if( my_client.exists() ) {
while (!my_client.call(my_srv) ) { // wait for 1 sec }
}
But that never seems to catch anything.
Using gdb, I get
#0 0x00007ffff59accc9 in raise () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x00007ffff59b00d8 in abort () from /lib/x86_64-linux-gnu/libc.so.6
#2 0x00007ffff62b7535 in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3 0x00007ffff62b56d6 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4 0x00007ffff62b5703 in std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5 0x00007ffff62b5922 in __cxa_throw () /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6 0x00007ffff6e99d38 in ros::ServiceServerLink::call(ros::SerializedMessage const&, ros::SerializedMessages&) () from /opt/ros/indigo/lib/libroscpp.so
#7 0x00007ffff6e9b02d in bool ros::ServiceClient::call(ros::SerializedMessage const&, ros::SerializedMessages&, std::string const&) () from /opt/ros/indigo/lib/libroscpp.so
#8 0x0000000000625242 in bool ros::ServiceClient::call>, my_msgs::MySrvResponse_>>(my_msgs::MySrvRequest_> const&, my_msgs::MySrvResponse_>&, std::string const&) ()
#9 0x000000000061c793 in bool ros::ServiceClient::call(my_msgs::MySrv&) ()
#10 0x0000000000613795 in call_my_service(ros::ServiceClient&, Eigen::Matrix const&, Controller<12ul, 4ul>&) ()
Any ideas where I should look? I've been debugging this for hours... cannot find the cause.
Note that the service does not always crash, only sometimes (but quite frequently).
I also noticed this in my master log towards the point where the node crashes:
(I've seen other people having the same errors without consequences, so I'm not sure if they are related.)
[rosmaster.master][INFO] 2015-07-24 09:09:05,565: -SERVICE [/my_namespace/rviz/get_loggers] /my_namespace/rviz rosrpc://my_pc
[rosmaster.threadpool][ERROR] 2015-07-24 09:09:05,565: Traceback (most recent call last):
File "/opt/ros/indigo/lib/python2.7/dist-packages/rosmaster/threadpool.py", line 218, in run
result = cmd(*args)
File "/opt/ros/indigo/lib/python2.7/dist-packages/rosmaster/master_api.py", line 208, in publisher_update_task
xmlrpcapi(api).publisherUpdate('/master', topic, pub_uris)
File "/usr/lib/python2.7/xmlrpclib.py", line 1233, in __call__
return self.__send(self.__name, args)
File "/usr/lib/python2.7/xmlrpclib.py", line 1587, in __request
verbose=self.__verbose
File "/usr/lib/python2.7/xmlrpclib.py", line 1273, in request
return self.single_request(host, handler, request_body, verbose)
File "/usr/lib/python2.7/xmlrpclib.py", line 1306, in single_request
return self.parse_response(response)
File "/usr/lib/python2.7/xmlrpclib.py", line 1482, in parse_response
return u.close()
File "/usr/lib/python2.7/xmlrpclib.py", line 794, in close
raise Fault(**self._stack[0])
Fault:
[rosmaster.master][INFO] 2015-07-24 09:09:05,566: -SERVICE [/my_namespace/rviz/reload_shaders] /my_namespace/rviz rosrpc://my_pc
[rosmaster.threadpool][ERROR] 2015-07-24 09:09:05,566: Traceback (most recent call last):
File "/opt/ros/indigo/lib/python2.7/dist-packages/rosmaster/threadpool.py", line 218, in run
result = cmd(*args)
File "/opt/ros/indigo/lib/python2.7/dist-packages/rosmaster/master_api.py", line 208, in publisher_update_task
xmlrpcapi(api).publisherUpdate('/master', topic, pub_uris)
File "/usr/lib/python2.7/xmlrpclib.py", line 1233, in __call__
return self.__send(self.__name, args)
File "/usr/lib/python2.7/xmlrpclib.py", line 1587, in __request
verbose=self.__verbose
File "/usr/lib/python2.7/xmlrpclib.py", line 1273, in request
return self.single_request(host, handler, request_body, verbose)
File "/usr/lib/python2.7/xmlrpclib.py", line 1301, in single_request
self.send_content(h, request_body)
File "/usr/lib/python2.7/xmlrpclib.py", line 1448, in send_content
connection.endheaders(request_body)
File "/usr/lib/python2.7/httplib.py", line 975, in endheaders
self._send_output(message_body)
File "/usr/lib/python2.7/httplib.py", line 835, in _send_output
self.send(msg)
File "/usr/lib/python2.7/httplib.py", line 797, in send
self.connect()
File "/usr/lib/python2.7/httplib.py", line 778, in connect
self.timeout, self.source_address)
File "/usr/lib/python2.7/socket.py", line 571, in create_connection
raise err
error: [Errno 111] Connection refused
Thanks!
↧
boost::bind with Ros Service
I have a ROS Service GripperState
---
int32 gripperState
int32 paddleState
And In my main.cpp file I have this line since I need gripper data from robot needs to be passed to service
ros::ServiceServer gripperService =
n.advertiseService
("GripperState",boost::bind(&gripperControl, node->getGripper(),
(my_robot::GripperState::Request &) _2, (my_robot::GripperState::Response &) _3));
In GripperServer.cpp I have the definition of method gripperControl
bool gripperControl(ArGripper *gripper, my_robot::GripperState::Request &req, my_robot::GripperState::Response &res)
{
int32_t gSt = gripper->getGripState();
int32_t pSt = gripper->getPaddleState();
ROS_INFO("GripperSt : %d, PaddleSt: %d", gSt, pSt);
res.gripperState = 5;
res.paddleState = 10;
return true;
}
However it compiles. It doesn't work since boost doesn't pass the placeholders _2 and _3 as references.(I think it creates a copy of each parameter).
Is there any way to make this work?
↧
subscriber msg: shared_ptr vs. reference
Hi!
I have a topic which is subscribed to by two different nodes. The subscribers used to have a
> const boost::shared_ptr<> nav_msgs::Odometry>
as variable. For several weeks, this worked well, until the code would randomly crash depending on how many lines of code were in the callback. Each time, it would kill the node and give a
> boost::thread_interrupted
error.
As an example, I could have three
> std::cout << "This is my message" <<> std::endl;
outputs in the callback without problems, but only two of them would make the node crash. A single one would be fine again.
I don't know much about what this means or how these pointer "counters" work behind the scene, but I imagined that there could be a problem when two callback functions want to access the same pointer at the same time from different nodes, i.e. different threads.
By replacing the
> const boost::shared_ptr< nav_msgs::Odometry>
by a reference
> const nav_msgs::Odometry&
the problem disappeared (at least up to now), which would support my crazy theory.
So the question:
Does this explanation remotely make sense?
Thanks!
**EDIT:**
For the sake of completeness, here is the gdb output of the crash.
> #0 0x00007ffff5997cc9 in raise () from /lib/x86_64-linux-gnu/libc.so.6> #1 0x00007ffff599b0d8 in abort () from /lib/x86_64-linux-gnu/libc.so.6> #2 0x00007ffff62a2535 in __gnu_cxx::__verbose_terminate_handler()> () from> /usr/lib/x86_64-linux-gnu/libstdc++.so.6> #3 0x00007ffff62a06d6 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6> #4 0x00007ffff62a0703 in std::terminate() () from> /usr/lib/x86_64-linux-gnu/libstdc++.so.6> #5 0x00007ffff62a0922 in __cxa_throw () from> /usr/lib/x86_64-linux-gnu/libstdc++.so.6> #6 0x00007ffff6e80815 in bool boost::condition_variable::timed_wait 1000000l>>>(boost::unique_lock&, boost::date_time::subsecond_duration 1000000l> const&) () from> /opt/ros/indigo/lib/libroscpp.so> #7 0x00007ffff6e7e6bd in ros::CallbackQueue::callAvailable(ros::WallDuration)> () from /opt/ros/indigo/lib/libroscpp.so> #8 0x00007ffff6ec24e5 in ros::SingleThreadedSpinner::spin(ros::CallbackQueue*)> () from /opt/ros/indigo/lib/libroscpp.so> #9 0x00007ffff6eaaaeb in ros::spin() () from> /opt/ros/indigo/lib/libroscpp.so> #10 0x0000000000671323 in main ()
↧
↧
[octomap_server-1] process has died
Hi All,
I get this error whenever i use launch the octomap_server , I havent had much success finding out where the error is ,
terminate called after throwing an instance of 'boost::exception_detail::clone_impl>'
what(): boost: mutex lock failed in pthread_mutex_lock: Invalid argument
[octomap_server-1] process has died [pid 2851, exit code -6, cmd /opt/ros/indigo/lib/octomap_server/octomap_server_node __name:=octomap_server
My launch file
` `
In the Gazebo Sim also rosservice call gazebo/unpause_physics
Kindly help me out here,
Thanks,
Jay
↧
PKG linked to static library linking error
I'm using ROS Indigo on Ubuntu 14.04 and the static library is a planner, namely the *[APPL Offline implements the SARSOP algorithm](http://bigbird.comp.nus.edu.sg/pmwiki/farm/appl/)*. I would like to run the planner in a ROS node and there is a static library created after compiling the appl code. While building the package I get an error.
In the source code I include one header and create an object (solver of a pomdp).
My CMakeFile looks like:
cmake_minimum_required(VERSION 2.8.3)
project(pomdp_planner)
find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
std_msgs
)
SET(APPL_LIB_DIR /home/user/UTwork/Planning/appl/branche/POP/src)
SET(SOURCES ${PROJECT_SOURCE_DIR}/src/main.cpp )
SET(HEADERS ${APPL_LIB_DIR}/OnlineOPSolver/OnlineOPsolver/solverOP_lib.hpp
${APPL_LIB_DIR}/OfflineSolver/GlobalResource.h
${APPL_LIB_DIR}/OfflineSolver/solverUtils.h
${APPL_LIB_DIR}/Parser/Cassandra/Parser.h
${APPL_LIB_DIR}/Parser/Cassandra/POMDP.h
${APPL_LIB_DIR}/Parser/ParserSelector.h
${APPL_LIB_DIR}/Models/MOMDP/MOMDP.h
${APPL_LIB_DIR}/Algorithms/SARSOP/SARSOP.h
${APPL_LIB_DIR}/Algorithms/OPMDP/OPMDP.h
${APPL_LIB_DIR}/Bounds/BackupAlphaPlaneMOMDP.h
${APPL_LIB_DIR}/Bounds/BackupBeliefValuePairMOMDP.h
${APPL_LIB_DIR}/OnlineOPSolver/OnlineOPsolver/dataLogger.h
${APPL_LIB_DIR}/Bounds/FastInfUBInitializer.h
${APPL_LIB_DIR}/Bounds/FullObsUBInitializer.h
${APPL_LIB_DIR}/Utils/CPTimer.h
${APPL_LIB_DIR}/Core/BeliefCache.h
)
SET(APPL_DIR ${APPL_LIB_DIR}/OnlineOPSolver/OnlineOPsolver
${APPL_LIB_DIR}/OfflineSolver
${APPL_LIB_DIR}/Parser/Cassandra
${APPL_LIB_DIR}/Parser/
${APPL_LIB_DIR}/Models/MOMDP
${APPL_LIB_DIR}/Algorithms/SARSOP
${APPL_LIB_DIR}/Algorithms/OPMDP
${APPL_LIB_DIR}/Bounds
${APPL_LIB_DIR}/Bounds
${APPL_LIB_DIR}/Utils
${APPL_LIB_DIR}/Core
${APPL_LIB_DIR}/MathLib
${APPL_LIB_DIR}/Algorithms
${APPL_LIB_DIR}/Parser/POMDPX
)
SET(LINKER_FLAG "-std=c++11 -fpermissive")
add_definitions(${LINKER_FLAG})
include_directories(${APPL_DIR})
add_executable(${PROJECT_NAME} ${SOURCES} ${HEADERS})
add_dependencies(${PROJECT_NAME} ${catkin_EXPORTED_TARGETS} )
target_link_libraries(${PROJECT_NAME} ${ROS_LIBRARIES} ${catkin_LIBRARIES} ${APPL_LIB_DIR}/libappl.a)
At linking phase I got an error `catkin build --this --force-cmake -G"Eclipse CDT4 - Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug`:
Starting ==> pomdp_planner
[pomdp_planner] ==> '/home/elod/catkin_ws/build/pomdp_planner/build_env.sh /usr/bin/make --jobserver-fds=3,5 -j' in '/home/elod/catkin_ws/build/pomdp_planner'
[ 0%] [ 0%] [ 0%] Built target std_msgs_generate_messages_py
Built target roscpp_generate_messages_lisp
Built target roscpp_generate_messages_cpp
[ 0%] Built target roscpp_generate_messages_py
[ 0%] [ 0%] Built target rosgraph_msgs_generate_messages_py
Built target rosgraph_msgs_generate_messages_cpp
[ 0%] Built target rosgraph_msgs_generate_messages_lisp
[ 0%] Built target std_msgs_generate_messages_cpp
[ 0%] Built target std_msgs_generate_messages_lisp
[100%] Building CXX object CMakeFiles/pomdp_planner.dir/src/main.cpp.o
In file included from /opt/ros/indigo/include/ros/transport_hints.h:34:0,
from /opt/ros/indigo/include/ros/subscribe_options.h:33,
from /opt/ros/indigo/include/ros/node_handle.h:41,
from /opt/ros/indigo/include/ros/ros.h:45,
from /home/elod/catkin_ws/src/solver/pomdp_planner/src/main.cpp:1:
/usr/include/boost/lexical_cast.hpp:75:49: error: expected initializer before : token
class BOOST_SYMBOL_VISIBLE bad_lexical_cast :
^
/home/elod/catkin_ws/src/solver/pomdp_planner/src/main.cpp:21:1: error: expected } at end of input
}
^
make[2]: *** [CMakeFiles/pomdp_planner.dir/src/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/pomdp_planner.dir/all] Error 2
make: *** [all] Error 2
[pomdp_planner] <== '/home/elod/catkin_ws/build/pomdp_planner/build_env.sh /usr/bin/make --jobserver-fds=3,5 -j' failed with return code '2'
Failed <== pomdp_planner [ 2.5 seconds ]
[build] There were '1' errors:
Failed to build package 'pomdp_planner' because the following command:
# Command to reproduce:
cd /home/elod/catkin_ws/build/pomdp_planner && /home/elod/catkin_ws/build/pomdp_planner/build_env.sh /usr/bin/make --jobserver-fds=3,5 -j; cd -
# Path to log:
cat /home/elod/catkin_ws/build/build_logs/pomdp_planner.log
Exited with return code: 2
I can build *appl* wihtout any problems and also could use the boost library in other nodes.
The makefile of the appl:
# The code is released under GPL v2
#
#
# Makefile for creating the APPL library and related executables.
#
#
# make
# Build all the targets.
#
# make clean
# Remove all the generated binaries.
#
# make install
# Install all the targets.
#
# make depend
# Generate source file dependencies.
#
# make parser
# Create the POMDP input file parser.
#
#
# ----------------------------------------------------------------------
# Customizations
# ----------------------------------------------------------------------
#
# root directory of the package
#
ROOT = ..
#
# destination directory
#
DESTDIR = $(ROOT)
#
# name of dependency file
#
DEPFILE = Makefile.dep
#
# detecting OS
#
uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not')
ifeq ($(uname_O),Cygwin)
CYGWIN_CFLAGS = -D_CYGWIN
CYGWIN_INCDIR = -I./miniposix/
endif
# ----------------------------------------------------------------------
# Compiler
# ----------------------------------------------------------------------
CC = gcc
CFLAGS = -g -w -O $(INCDIR) -msse2 -mfpmath=sse $(CYGWIN_CFLAGS)
# -DDEBUG_LOG_ON
CXX = g++
CXXFLAGS = $(CFLAGS)
INCDIR = -I./Algorithms/OPMDP/ -I./OnlineOPSolver/OnlineOPSolver/ -I./MathLib -I./Algorithms -I./Algorithms/HSVI -I./Algorithms/SARSOP -I./Models/MOMDP/ -I./Models/MOMDP/CoLoc/ -I./OfflineSolver/ -I./Bounds/ -I./Core/ -I./Parser/Cassandra/ -I./Parser/Cassandra/include -I./Parser/ -I./Parser/POMDPX/ -I./Utils/ -I./Simulator/ -I./Evaluator/ -I./Controller/ $(CYGWIN_INCDIR)
# -I./OnlineOPSolver
# ----------------------------------------------------------------------
# Linker
# ----------------------------------------------------------------------
LINKER = g++
LDFLAGS = -L.
LIBS = -lappl #-lopencv_core -lopencv_highgui -lopencv_imgproc -lopencv_imgcodecs
# ----------------------------------------------------------------------
# Archiver
# ----------------------------------------------------------------------
ARCHIVER = ar
ARFLAGS = -ruv
# ----------------------------------------------------------------------
# Others
# ----------------------------------------------------------------------
PRINT = lpr
# ----------------------------------------------------------------------
# Files
# ----------------------------------------------------------------------
TARGETS = $(TARGET_APPL) $(TARGET_OFSOL) $(TARGET_ONSOL) $(TARGET_SIM) $(TARGET_EVA) $(TARGET_GRAPH) $(TARGET_CONVERT) $(TARGET_CTRL)
HDRS = $(HDRS_APPL) $(HDRS_OFSOL) $(HDRS_ONSOL) $(HDRS_SIM) $(HDRS_EVA) $(HDRS_GRAPH) $(HDRS_CONVERT) $(HDRS_CTRL)
SRCS = $(SRCS_APPL) $(SRCS_OFSOL) $(SRCS_ONSOL) $(SRCS_SIM) $(SRCS_EVA) $(SRCS_GRAPH) $(SRCS_CONVERT) $(HDRS_CTRL)
OBJS = $(OBJS_APPL) $(OBJS_OFSOL) $(OBJS_ONSOL) $(OBJS_SIM) $(OBJS_EVA) $(OBJS_GRAPH) $(OBJS_CONVERT) $(OBJS_CTRL)
#
# source file directories
#
#
# target: evaluate
#
TARGET_EVA = pomdpeval
HDRS_EVA =
SRCS_EVA = ./Evaluator/Evaluator.cpp
OBJS_EVA = $(SRCS_EVA:.cpp=.o) # C++ object targets
#
# target: simulate
#
TARGET_SIM = pomdpsim
HDRS_SIM =
SRCS_SIM = ./Simulator/Simulator.cpp
OBJS_SIM = $(SRCS_SIM:.cpp=.o) # C++ object targets
#
# target: offline solver
#
TARGET_OFSOL = pomdpsol
HDRS_OFSOL =
SRCS_OFSOL = ./OfflineSolver/solver.cpp
OBJS_OFSOL = $(SRCS_OFSOL:.cpp=.o) # C++ object targets
#
# target: online solver
#
TARGET_ONSOL = pomdpOnlineSol
HDRS_ONSOL =
SRCS_ONSOL = ./OnlineOPSolver/OnlineOPsolver/solverOP.cpp
OBJS_ONSOL = $(SRCS_ONSOL:.cpp=.o) # C++ object targets
#
# target: policy graph plotter
#
TARGET_GRAPH = polgraph
HDRS_GRAPH =
SRCS_GRAPH = ./PolicyGraph/PolicyGraph.cpp
OBJS_GRAPH = $(SRCS_GRAPH:.cpp=.o) # C++ object targets
#
# target: pomdp to pomdpx convertor
#
TARGET_CONVERT = pomdpconvert
HDRS_CONVERT =
SRCS_CONVERT = ./PomdpConvertor/convertor.cpp
OBJS_CONVERT = $(SRCS_CONVERT:.cpp=.o) # C++ object targets
#
# target: library
#
TARGET_APPL = libappl.a
HDRS_APPL = ./OnlineOPSolver/OnlineOPsolver/solverOP_lib.hpp \
./OnlineOPSolver/OnlineOPsolver/dataLogger.h \
./Algorithms/OPMDP/OPBeliefTreeNode.h \
./Algorithms/OPMDP/OPMDP.h \
./PolicyGraph/PolicyGraphGenerator.h \
./Evaluator/EvaluationEngine.h \
./Evaluator/EvaluatorBeliefTreeNodeTuple.h \
./Evaluator/EvaluatorSampleEngine.h \
./Simulator/SimulationEngine.h \
./MathLib/DenseVector.cpp \
./MathLib/DenseVector.h \
./MathLib/MathLib.cpp \
./MathLib/MathLib.h \
./MathLib/SparseMatrix.cpp \
./MathLib/SparseMatrix.h \
./MathLib/SparseVector.cpp \
./MathLib/SparseVector.h \
./Algorithms/PointBasedAlgorithm.h \
./Algorithms/SARSOP/AlphaPlaneMaxMeta.h \
./Algorithms/SARSOP/BinManager.cpp \
./Algorithms/SARSOP/BinManager.h \
./Algorithms/SARSOP/BinManagerSet.cpp \
./Algorithms/SARSOP/BinManagerSet.h \
./Algorithms/SARSOP/Prune.h \
./Algorithms/SARSOP/Sample.cpp \
./Algorithms/SARSOP/Sample.h \
./Algorithms/SARSOP/SampleBP.cpp \
./Algorithms/SARSOP/SampleBP.h \
./Algorithms/SARSOP/SARSOP.cpp \
./Algorithms/SARSOP/SARSOP.h \
./Algorithms/SARSOP/SARSOPPrune.cpp \
./Algorithms/SARSOP/SARSOPPrune.h \
./miniposix/getopt.h \
./miniposix/getopt_int.h \
$(wildcard ./Models/MOMDP/*.h) \
./OfflineSolver/GlobalResource.h \
./OfflineSolver/solverUtils.h \
./Bounds/BlindLBInitializer.h \
./Bounds/AlphaPlane.h \
./Bounds/AlphaPlanePool.h \
./Bounds/AlphaPlanePoolSet.h \
./Bounds/AlphaVectorPolicy.h \
./Bounds/BackupAlphaPlaneMOMDP.h \
./Bounds/BackupAlphaPlaneMOMDPLite.h \
./Bounds/BackupBeliefValuePairMOMDP.h \
./Bounds/BackupBeliefValuePairMOMDPLite.h \
./Bounds/BeliefValuePair.h \
./Bounds/BeliefValuePairPool.h \
./Bounds/BeliefValuePairPoolSet.h \
./Bounds/FastInfUBInitializer.h \
./Bounds/FullObsUBInitializer.h \
./Bounds/PruneAlphaPlane.cpp \
./Bounds/PruneAlphaPlane.h \
./Bounds/PruneBeliefValuePair.h \
./Bounds/xml_parse_lib.h \
./Evaluator/EvaluatorBeliefTreeNodeTuple.h \
./Core/FacmodelStructs.h \
./Core/Actions.h \
./Core/Backup.h \
./Core/Belief.h \
./Core/BeliefCache.h \
./Core/Policy.h \
./Core/BeliefCacheRow.h \
./Core/BeliefException.h \
./Core/BeliefForest.h \
./Core/BeliefTransition.h \
./Core/BeliefTreeNode.h \
./Core/BeliefWithState.h \
./Core/VariableContainer.h \
./Core/Bound.h \
./Core/BoundSet.h \
./Core/Const.h \
./Core/IndexedTuple.h \
./Core/MObject.h \
./Core/MObjectManager.h \
./Core/MObjectUser.h \
./Core/Observations.h \
./Core/States.h \
./Core/SymbolSet.h \
./Core/SymbolSetIterator.h \
./Core/Tuple.h \
./Core/UniqueBeliefHeap.h \
./Parser/Cassandra/decision-tree.h \
./Parser/Cassandra/imm-reward.h \
./Parser/Cassandra/include/pomdp_spec.tab.hh \
./Parser/Cassandra/MDP.h \
./Parser/Cassandra/mdpCassandra.h \
./Parser/Cassandra/Parser.h \
./Parser/Cassandra/parse_constant.h \
./Parser/Cassandra/parse_err.h \
./Parser/Cassandra/parse_hash.h \
./Parser/Cassandra/POMDP.h \
./Parser/Cassandra/pomdpCassandraWrapper.h \
./Parser/Cassandra/sparse-matrix.h \
./Parser/ParserSelector.h \
./Parser/POMDPX/FactoredPomdp.h \
./Parser/POMDPX/Function.h \
./Parser/POMDPX/ObsAct.h \
./Parser/POMDPX/POMDPLayer.h \
./Parser/POMDPX/PreCEntry.h \
./Parser/POMDPX/PreCMatrix.h \
./Parser/POMDPX/SparseEntry.h \
./Parser/POMDPX/SparseTable.h \
./Parser/POMDPX/State.h \
./Parser/POMDPX/StateObsAct.h \
./Parser/POMDPX/tinystr.h \
./Parser/POMDPX/tinyxml.h \
./Parser/POMDPX/UniqueIndex.h \
./Utils/CPMemUtils.h \
./Utils/CPTimer.h \
./Utils/Cache.h \
./Utils/InfoLog.h \
./Utils/md5.h \
./Utils/md5wrapper.h \
./Utils/StatsCollector.h \
./Utils/SimulationRewardCollector.h \
./Parser/Cassandra/include/pomdp_spec.tab.hh \
./Controller/ControllerInterface.h \
./Controller/Controller.h
SRCS_APPL = ./OnlineOPSolver/OnlineOPsolver/solverOP_lib.cpp \
./OnlineOPSolver/OnlineOPsolver/dataLogger.cpp \
./Algorithms/OPMDP/OPBeliefTreeNode.cpp \
./Algorithms/OPMDP/OPMDP.cpp \
./PolicyGraph/PolicyGraph.cpp \
./PolicyGraph/PolicyGraphGenerator.cpp \
./Evaluator/EvaluationEngine.cpp \
./Evaluator/EvaluatorSampleEngine.cpp \
./Simulator/SimulationEngine.cpp \
./MathLib/DenseVector.cpp \
./MathLib/MathLib.cpp \
./MathLib/SparseMatrix.cpp \
./MathLib/SparseVector.cpp \
./Algorithms/SARSOP/BinManager.cpp \
./Algorithms/SARSOP/BinManagerSet.cpp \
./Algorithms/SARSOP/Sample.cpp \
./Algorithms/SARSOP/SampleBP.cpp \
./Algorithms/SARSOP/SARSOP.cpp \
./Algorithms/SARSOP/SARSOPPrune.cpp \
$(wildcard ./Models/MOMDP/*.cpp) \
./OfflineSolver/GlobalResource.cpp \
./OfflineSolver/solverUtils.cpp \
./Bounds/AlphaPlane.cpp \
./Bounds/AlphaPlanePool.cpp \
./Bounds/AlphaPlanePoolSet.cpp \
./Bounds/AlphaVectorPolicy.cpp \
./Bounds/BackupAlphaPlaneMOMDP.cpp \
./Bounds/BackupAlphaPlaneMOMDPLite.cpp \
./Bounds/BackupBeliefValuePairMOMDP.cpp \
./Bounds/BackupBeliefValuePairMOMDPLite.cpp \
./Bounds/BeliefValuePair.cpp \
./Bounds/BeliefValuePairPool.cpp \
./Bounds/BeliefValuePairPoolSet.cpp \
./Bounds/BlindLBInitializer.cpp \
./Bounds/FastInfUBInitializer.cpp \
./Bounds/FullObsUBInitializer.cpp \
./Bounds/PruneAlphaPlane.cpp \
./Bounds/PruneBeliefValuePair.cpp \
./Bounds/xml_parse_lib.c \
./Core/Actions.cpp \
./Core/VariableContainer.cpp \
./Core/Belief.cpp \
./Core/BeliefCache.cpp \
./Core/BeliefException.cpp \
./Core/BeliefForest.cpp \
./Core/BeliefTreeNode.cpp \
./Core/BeliefWithState.cpp \
./Core/MObject.cpp \
./Core/Observations.cpp \
./Core/States.cpp \
./Core/UniqueBeliefHeap.cpp \
./Parser/Cassandra/Parser.cpp \
./Parser/Cassandra/POMDP.cpp \
./Parser/Cassandra/pomdpCassandraWrapper.cpp \
./Parser/ParserSelector.cpp \
./Parser/POMDPX/FactoredPomdp.cpp \
./Parser/POMDPX/Function.cpp \
./Parser/POMDPX/ObsAct.cpp \
./Parser/POMDPX/PreCEntry.cpp \
./Parser/POMDPX/PreCMatrix.cpp \
./Parser/POMDPX/SparseEntry.cpp \
./Parser/POMDPX/SparseTable.cpp \
./Parser/POMDPX/State.cpp \
./Parser/POMDPX/StateObsAct.cpp \
./Parser/POMDPX/tinystr.cpp \
./Parser/POMDPX/tinyxml.cpp \
./Parser/POMDPX/tinyxmlerror.cpp \
./Parser/POMDPX/tinyxmlparser.cpp \
./Utils/InfoLog.cpp \
./Utils/md5.cpp \
./Utils/md5wrapper.cpp \
./Utils/CPMemUtils.cpp \
./Utils/StatsCollector.cpp \
./Utils/SimulationRewardCollector.cpp \
./Parser/Cassandra/include/pomdp_spec.tab.cc \
./Parser/Cassandra/include/pomdp_spec.yy.cc \
./miniposix/getopt.c \
./miniposix/getopt1.c \
./miniposix/getopt_init.c \
./Parser/Cassandra/decision-tree.c \
./Parser/Cassandra/imm-reward.c \
./Parser/Cassandra/mdpCassandra.c \
./Parser/Cassandra/parse_err.c \
./Parser/Cassandra/parse_hash.c \
./Parser/Cassandra/sparse-matrix.c \
./Controller/Controller.cpp
OBJS_APPL_C = $(SRCS_APPL:.c=.o) # C object targets
OBJS_APPL_CC = $(OBJS_APPL_C:.cc=.o) # C++ object targets
OBJS_APPL = $(OBJS_APPL_CC:.cpp=.o) # C++ object targets
#
# target: controller
#
TARGET_CTRL = testControllerTiger
HDRS_CTRL =
SRCS_CTRL = ./Controller/testControllerTiger.cpp
OBJS_CTRL = $(SRCS_CTRL:.cpp=.o) # C++ object targets
# ----------------------------------------------------------------------
# Targets
# ----------------------------------------------------------------------
all: $(TARGETS)
$(TARGET_APPL): $(OBJS_APPL)
$(ARCHIVER) $(ARFLAGS) $(TARGET_APPL) $(OBJS_APPL)
ranlib $(TARGET_APPL)
$(TARGET_OFSOL): $(OBJS_OFSOL) $(TARGET_APPL)
$(LINKER) $(LDFLAGS) $(OBJS_OFSOL) $(LIBS) -o $(TARGET_OFSOL)
#ONLINE Solver PAEL
$(TARGET_ONSOL): $(OBJS_ONSOL) $(TARGET_APPL)
$(LINKER) $(LDFLAGS) $(OBJS_ONSOL) $(LIBS) -o $(TARGET_ONSOL)
$(TARGET_SIM): $(OBJS_SIM) $(TARGET_APPL)
$(LINKER) $(LDFLAGS) $(OBJS_SIM) $(LIBS) -o $(TARGET_SIM)
$(TARGET_EVA): $(OBJS_EVA) $(TARGET_APPL)
$(LINKER) $(LDFLAGS) $(OBJS_EVA) $(LIBS) -o $(TARGET_EVA)
$(TARGET_GRAPH):$(OBJS_GRAPH) $(TARGET_APPL)
$(LINKER) $(LDFLAGS) $(OBJS_GRAPH) $(LIBS) -o $(TARGET_GRAPH)
$(TARGET_CONVERT):$(OBJS_CONVERT) $(TARGET_APPL)
$(LINKER) $(LDFLAGS) $(OBJS_CONVERT) $(LIBS) -o $(TARGET_CONVERT)
$(TARGET_CTRL):$(OBJS_CTRL) $(TARGET_APPL)
$(LINKER) $(LDFLAGS) $(OBJS_CTRL) $(LIBS) -o $(TARGET_CTRL)
clean:; rm -f $(OBJS)
rm -f $(TARGETS)
install: $(TARGETS)
[ -d ../bin ] || mkdir ../bin
[ -d ../lib ] || mkdir ../lib
mv $(TARGET_OFSOL) $(DESTDIR)/bin/$(TARGET_OFSOL)
mv $(TARGET_ONSOL) $(DESTDIR)/bin/$(TARGET_ONSOL)
mv $(TARGET_APPL) $(DESTDIR)/lib/$(TARGET_APPL)
depend:; g++ -MM $(INCDIR) $(HDRS) $(SRCS) > $(DEPFILE)
#depend:; makedepend -Y $(INCDIR) $(SRCS)
.PHONY: parser
parser:; cd $(ParserDIR) && $(MAKE)
echo:; echo $(TARGETS);
#update: $(DEST)/$(PROGRAM)
#print:; $(PRINT) $(HDRS) $(SRCS)
include $(DEPFILE)
# DO NOT DELETE
↧
Problem with ROS and Arduino
Hi, Im new with ROS and i have problem with compilation on Arduino. When I'm trying to compile HelloWorld example i'm getting error like this:
In file included from /opt/ros/jade/include/ros/node_handle.h:31:0,
from /home/lukasz/Pulpit/arduino-1.6.4/libraries/ros_lib/ros.h:38,
from sketch_dec25a.ino:2:
/opt/ros/jade/include/ros/forwards.h:37:32: fatal error: boost/shared_ptr.hpp: No such file or directory
#include
^
compilation terminated.
I have ubuntu 14.04 and just installed ROS. I have boost library in 1.54 version. What I should do to run this program?
↧
boost 1.60 with ROS Jade
I'd like to use boost 1.55 or later with ROS Jade.
How can I do it correctly ? If possible, I'd like to use boost installed locally.
As I show later, roscpp depends on boost 1.54.0 and it seems to lead to serious problem. What I've done is like the follows. 1. Installed boost 1.60 locally (into ~/Libs/boost).
Now header files and .a and .so files are in ~/Libs/boost/incude and ~/Libs/boost/lib respectively 2. In CMakeLists.txt,
>set(LIB_ROOT "~/Libs")
set(Boost_INCLUDE_DIR ${LIB_ROOT}/boost/include)
set(Boost_LIBRARY_DIR ${LIB_ROOT}/boost/lib)
find_package(Boost 1.60 REQUIRED)
include_directories(${Boost_INCLUDE_DIR})
link_directories(${Boost_LIBRARY_DIR}) 3. Removed build and devel directories in catkin_ws and catkin_make As a result, I have warnings as the follows: link library [libboost_\*\*\*\*.so] in /usr/lib/x86_64-linux-gnu may be hidden by files in:/boost/lib
and
/usr/bin/ld: warning: libboost_\*\*\*\*.so.1.54.0, needed by /opt/ros/jade/lib/libroscpp.so, may conflict with libboost_thread.so.1.60.0
Warnings make sense because I did it on purpose.
But the warning is really scaring. I'm afraid that it was really linked correctly. What's wrong with my way ?
Should I link boost libraries statically ?
In that case, how can I do it with catkin ? Thanks in advance.
How can I do it correctly ? If possible, I'd like to use boost installed locally.
As I show later, roscpp depends on boost 1.54.0 and it seems to lead to serious problem. What I've done is like the follows. 1. Installed boost 1.60 locally (into ~/Libs/boost).
Now header files and .a and .so files are in ~/Libs/boost/incude and ~/Libs/boost/lib respectively 2. In CMakeLists.txt,
>set(LIB_ROOT "~/Libs")
set(Boost_INCLUDE_DIR ${LIB_ROOT}/boost/include)
set(Boost_LIBRARY_DIR ${LIB_ROOT}/boost/lib)
find_package(Boost 1.60 REQUIRED)
include_directories(${Boost_INCLUDE_DIR})
link_directories(${Boost_LIBRARY_DIR}) 3. Removed build and devel directories in catkin_ws and catkin_make As a result, I have warnings as the follows: link library [libboost_\*\*\*\*.so] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
But the warning is really scaring. I'm afraid that it was really linked correctly. What's wrong with my way ?
Should I link boost libraries statically ?
In that case, how can I do it with catkin ? Thanks in advance.
↧
↧
Building error: Indigo on Debian Jessie: pluginlib "undefined reference to..."
Hi there,
I am currently trying to build ROS indigo from source on my Debian Jessie machine. I keep on getting the following error when the process is trying to build the package "pluginlib". I am really stuck here and would appreciate your help on this!
Thanks!
Linking CXX executable /home/tman/ros_catkin_ws/devel_isolated/pluginlib/lib/pluginlib/plugin_tool
/opt/ros/indigo/lib/librosconsole.so: undefined reference to `boost::re_detail::verify_options(unsigned int, boost::regex_constants::_match_flags)'
/opt/ros/indigo/lib/librosconsole.so: undefined reference to `boost::re_detail::get_mem_block()'
/opt/ros/indigo/lib/librosconsole.so: undefined reference to `boost::match_results<__gnu_cxx::__normal_iterator, std::allocator>>>::maybe_assign(boost::match_results<__gnu_cxx::__normal_iterator, std::allocator>>> const&)'
/opt/ros/indigo/lib/librosconsole.so: undefined reference to `boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator, std::allocator>>, boost::regex_traits>>::construct_init(boost::basic_regex>> const&, boost::regex_constants::_match_flags)'
/opt/ros/indigo/lib/librosconsole.so: undefined reference to `boost::re_detail::cpp_regex_traits_implementation::transform_primary(char const*, char const*) const'
/opt/ros/indigo/lib/librosconsole.so: undefined reference to `boost::re_detail::get_default_error_string(boost::regex_constants::error_type)'
/opt/ros/indigo/lib/librosconsole.so: undefined reference to `boost::re_detail::cpp_regex_traits_implementation::transform(char const*, char const*) const'
/opt/ros/indigo/lib/librosconsole.so: undefined reference to `boost::re_detail::put_mem_block(void*)'
/opt/ros/indigo/lib/librosconsole.so: undefined reference to `boost::basic_regex>>::do_assign(char const*, char const*, unsigned int)'
/opt/ros/indigo/lib/librosconsole.so: undefined reference to `boost::re_detail::raise_runtime_error(std::runtime_error const&)'
collect2: error: ld returned 1 exit status
CMakeFiles/plugin_tool.dir/build.make:116: recipe for target '/home/tman/ros_catkin_ws/devel_isolated/pluginlib/lib/pluginlib/plugin_tool' failed
make[2]: *** [/home/tman/ros_catkin_ws/devel_isolated/pluginlib/lib/pluginlib/plugin_tool] Error 1
CMakeFiles/Makefile2:310: recipe for target 'CMakeFiles/plugin_tool.dir/all' failed
make[1]: *** [CMakeFiles/plugin_tool.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2<== Failed to process package 'pluginlib':
Command '['/opt/ros/indigo/env.sh', 'make', '-j4', '-l4']' returned non-zero exit status 2
Reproduce this error by running:
==> cd /home/tman/ros_catkin_ws/build_isolated/pluginlib && /opt/ros/indigo/env.sh make -j4 -l4
Command failed, exiting.
↧
Redeclare loop_rate depending on boolean
Given this example, in which I want to decide via `if` which loop_rate to use when spinning
if(my_bool) ros::Rate loop_rate(100); //Hz
else ros::Rate loop_rate(10);
//thread safe regular mutex spin
mtx_spin.lock();
ros::spinOnce();
mtx_spin.unlock();
loop_rate.sleep();
The compiler complains about rate not declared, as it is out of scope. But I need the `if` to decide which rate to get.
↧
Thread safe spinning with Mutex and boost::threads
I have several threads accessing the same function. To guarantee safe spinning, which means none of the threads calls ` ros::spinOnce()` at the same time I used a regular mutex. So if the threads wants to spin he has to lock it before, so in case he gets interrupted another thread cannot spin meanwhile, until the locking thread gets cpu-time again and releases the lock.
Is this approach good/bad Idea?
boost::mutex safespinmutex; #include
#include
#include
boost::mutex mtx_spin; //shared by publisher threads
//thread safe regular mutex spin
mtx_spin.lock();
ros::spinOnce();
mtx_spin.unlock();
loop_rate.sleep();
}
It is similar to c11 mutex, just here I use c98 syntax with `boost::threads and boost::mutex` :)
**Edit more Info**
I spawn a maximum of 13 threads each dedicated to publishing, which is a lot, but I dont see any problem: The call to `lock()` blocks the thread if another thread is inside the `spinOnce()` but yet not finished. Once done this thread unlocks the mutex and unblocks the waiting thread. voila or am I conceptually wrong?
This is how I start the publishing threads boost::thread tpool[14]; //thread pool int pool = 0; for (unsigned i=0; i<13; i++){ if(rate_eff[i]!=0) { tpool[pool++] = boost::thread(publisher,(i+1), use_def); } } cout<<" publishing on "<<(pool-1)<<" topics:"<**Benchmark**
To confirm what said above I spawned 9 topics each managed by their own publisher thread. One Incoming thread sorts stuff into the internal vectors rate(100Hz) and the 9 publisher threads read it with `1000Hz rate` and push it onto their topic. Does it run safe: Yes.
I am glad about suggestions and improvements but please fortify your statement.

In case you want to have a look at the complete code [here](https://drive.google.com/file/d/0B_MzoTKF7WAidTRheVFvT3Q4YlE/view?usp=sharing).
Is this approach good/bad Idea?
boost::mutex safespinmutex; #include
**Edit more Info**
I spawn a maximum of 13 threads each dedicated to publishing, which is a lot, but I dont see any problem: The call to `lock()` blocks the thread if another thread is inside the `spinOnce()` but yet not finished. Once done this thread unlocks the mutex and unblocks the waiting thread. voila or am I conceptually wrong?
This is how I start the publishing threads boost::thread tpool[14]; //thread pool int pool = 0; for (unsigned i=0; i<13; i++){ if(rate_eff[i]!=0) { tpool[pool++] = boost::thread(publisher,(i+1), use_def); } } cout<<" publishing on "<<(pool-1)<<" topics:"<
To confirm what said above I spawned 9 topics each managed by their own publisher thread. One Incoming thread sorts stuff into the internal vectors rate(100Hz) and the 9 publisher threads read it with `1000Hz rate` and push it onto their topic. Does it run safe: Yes.
I am glad about suggestions and improvements but please fortify your statement.

In case you want to have a look at the complete code [here](https://drive.google.com/file/d/0B_MzoTKF7WAidTRheVFvT3Q4YlE/view?usp=sharing).
↧