Giter Site home page Giter Site logo

ros / console_bridge Goto Github PK

View Code? Open in Web Editor NEW
21.0 21.0 62.0 432 KB

A ROS-independent package for logging that seamlessly pipes into rosconsole/rosout for ROS-dependent packages.

License: BSD 3-Clause "New" or "Revised" License

C++ 97.72% CMake 1.28% C 1.00%

console_bridge's Introduction

Robot Operating System (ROS)
===============================================================================

ROS is a meta-operating system for your robot.  It provides
language-independent and network-transparent communication for a
distributed robot control system.

Installation Notes
------------------

For full installation instructions, including system prerequisites and
platform-specific help, see:

  http://wiki.ros.org/ROS/Installation

console_bridge's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

console_bridge's Issues

Target is not correctly being exported, missing INTERFACE_INCLUDE_DIRECTORIES.

I ran into an issue where my project could not find the header console_bridge/console_bridge.h event though find_package was able to find the package. After further investigation I found that the target console_bridge::console_bridge provided by does not set the targets INTERFACE_INCLUDE_DIRECTORIES, but it does set the cmake variable console_bridge_INCLUDE_DIRS.

Reproduce:

find_package(console_bridge REQUIRED)
get_target_property(GET_INCLUDES console_bridge::console_bridge INTERFACE_INCLUDE_DIRECTORIES)
message(AUTHOR_WARNING "console_bridge Interface Includes: ${GET_INCLUDES}")

add_library(${PROJECT_NAME} src/osqp_eigen_solver.cpp)
target_link_libraries(${PROJECT_NAME} PUBLIC console_bridge::console_bridge)

Output:

console_bridge Interface Includes: GET_INCLUDES-NOTFOUND

A lot of undefined references on compiling on arch linux

Tried to compile version 0.4.1 on arch linux and recieved following error.
Please help.
[ 12%] Linking CXX shared library lib/libconsole_bridge.so [ 25%] Building CXX object test/CMakeFiles/gtest.dir/gtest/src/gtest-all.cc.obj CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0x118): undefined reference to std::basic_ostream<char, std::char_traits >& std::__ostream_insert<char, std::char_traits >(std::basic_ostream<char, std::char_traits >&, char const*, long long)'
CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0x149): undefined reference to std::ostream::put(char)' CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0x151): undefined reference to std::ostream::flush()'
CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0x167): undefined reference to std::ctype<char>::_M_widen_init() const' CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0x18e): undefined reference to std::__throw_bad_cast()'
CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0x1e9): undefined reference to std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, long long)' CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0x1fc): undefined reference to std::basic_ostream<char, std::char_traits >& std::__ostream_insert<char, std::char_traits >(std::basic_ostream<char, std::char_traits >&, char const*, long long)'
CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0x22d): undefined reference to std::ostream::put(char)' CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0x235): undefined reference to std::ostream::flush()'
CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0x24e): undefined reference to std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, long long)' CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0x25c): undefined reference to std::ostream::operator<<(int)'
CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0x274): undefined reference to std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, long long)' CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0x293): undefined reference to std::basic_ostream<char, std::char_traits >& std::__ostream_insert<char, std::char_traits >(std::basic_ostream<char, std::char_traits >&, char const*, long long)'
CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0x2c1): undefined reference to std::ostream::put(char)' CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0x2c9): undefined reference to std::ostream::flush()'
CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0x300): undefined reference to std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, long long)' CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0x313): undefined reference to std::basic_ostream<char, std::char_traits >& std::__ostream_insert<char, std::char_traits >(std::basic_ostream<char, std::char_traits >&, char const*, long long)'
CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0x344): undefined reference to std::ostream::put(char)' CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0x34c): undefined reference to std::ostream::flush()'
CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0x368): undefined reference to std::ctype<char>::_M_widen_init() const' CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0x399): undefined reference to std::ctype::_M_widen_init() const'
CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0x3d4): undefined reference to std::ctype<char>::_M_widen_init() const' CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0x416): undefined reference to std::basic_ios<char, std::char_traits >::clear(std::_Ios_Iostate)'
CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0x431): undefined reference to std::basic_ios<char, std::char_traits<char> >::clear(std::_Ios_Iostate)' CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0x455): undefined reference to std::basic_ios<char, std::char_traits >::clear(std::_Ios_Iostate)'
CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0x45f): undefined reference to std::__throw_bad_cast()' CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0x4b5): undefined reference to std::basic_ostream<char, std::char_traits >& std::__ostream_insert<char, std::char_traits >(std::basic_ostream<char, std::char_traits >&, char const*, long long)'
CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0x4e6): undefined reference to std::ostream::put(char)' CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0x504): undefined reference to std::ctype::_M_widen_init() const'
CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0x52b): undefined reference to std::__throw_bad_cast()' CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0x598): undefined reference to __cxa_guard_acquire'
CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0x5eb): undefined reference to __cxa_guard_release' CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0x603): undefined reference to std::__throw_system_error(int)'
CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0x669): undefined reference to __cxa_guard_acquire' CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0x6bc): undefined reference to __cxa_guard_release'
CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0x6d4): undefined reference to std::__throw_system_error(int)' CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0x748): undefined reference to __cxa_guard_acquire'
CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0x79b): undefined reference to __cxa_guard_release' CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0x7b3): undefined reference to std::__throw_system_error(int)'
CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0x7ed): undefined reference to __cxa_guard_acquire' CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0x840): undefined reference to __cxa_guard_release'
CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0x8ed): undefined reference to __cxa_guard_acquire' CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0x940): undefined reference to __cxa_guard_release'
CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0xa23): undefined reference to operator delete(void*)' CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0xa4c): undefined reference to std::__cxx11::basic_string<char, std::char_traits, std::allocator >::_M_create(unsigned long long&, unsigned long long)'
CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0xae1): undefined reference to std::__throw_system_error(int)' CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0xaf7): undefined reference to operator delete(void*)'
CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0xb78): undefined reference to __cxa_guard_acquire' CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0xbcb): undefined reference to __cxa_guard_release'
CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0xbe3): undefined reference to std::__throw_system_error(int)' CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0xc48): undefined reference to __cxa_guard_acquire'
CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0xc9b): undefined reference to __cxa_guard_release' CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0xcb3): undefined reference to std::__throw_system_error(int)'
CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0xd0a): undefined reference to std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, long long)' CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0xd2d): undefined reference to std::basic_ostream<char, std::char_traits >& std::__ostream_insert<char, std::char_traits >(std::basic_ostream<char, std::char_traits >&, char const*, long long)'
CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0xd4d): undefined reference to std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, long long)' CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0xd77): undefined reference to std::ostream::put(char)'
CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0xd94): undefined reference to std::ctype<char>::_M_widen_init() const' CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0xdd8): undefined reference to std::basic_ios<char, std::char_traits >::clear(std::_Ios_Iostate)'
CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0xde2): undefined reference to std::__throw_bad_cast()' CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0xc8): undefined reference to std::ios_base::Init::~Init()'
CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0xff): undefined reference to operator delete(void*)' CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0x15f): undefined reference to operator delete(void*)'
CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0x2dd): undefined reference to std::ostream::flush()' CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0x360): undefined reference to std::ostream::flush()'
CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0x4f3): undefined reference to std::ostream::flush()' CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text+0xd85): undefined reference to std::ostream::flush()'
CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.xdata+0x4): undefined reference to __gxx_personality_seh0' CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.xdata+0x34): undefined reference to __gxx_personality_seh0'
CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.xdata+0x54): undefined reference to __gxx_personality_seh0' CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.xdata+0x68): undefined reference to __gxx_personality_seh0'
CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.xdata+0x88): undefined reference to __gxx_personality_seh0' CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.xdata+0xa8): more undefined references to __gxx_personality_seh0' follow
CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text$_ZN14console_bridge16OutputHandlerSTDD0Ev[_ZN14console_bridge16OutputHandlerSTDD0Ev]+0x1): undefined reference to operator delete(void*)' CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.text.startup+0xc): undefined reference to std::ios_base::Init::Init()'
CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.rdata$_ZTIN14console_bridge13OutputHandlerE[_ZTIN14console_bridge13OutputHandlerE]+0x0): undefined reference to vtable for __cxxabiv1::__class_type_info' CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.rdata$_ZTIN14console_bridge16OutputHandlerSTDE[_ZTIN14console_bridge16OutputHandlerSTDE]+0x0): undefined reference to vtable for __cxxabiv1::__si_class_type_info'
CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.rdata$_ZTIN14console_bridge17OutputHandlerFileE[_ZTIN14console_bridge17OutputHandlerFileE]+0x0): undefined reference to vtable for __cxxabiv1::__si_class_type_info' CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.rdata$.refptr._ZSt4cout[.refptr._ZSt4cout]+0x0): undefined reference to std::cout'
CMakeFiles/console_bridge.dir/src/console.cpp.obj:console.cpp:(.rdata$.refptr._ZSt4cerr[.refptr._ZSt4cerr]+0x0): undefined reference to std::cerr' collect2.exe: error: ld returned 1 exit status make[2]: *** [CMakeFiles/console_bridge.dir/build.make:84: lib/libconsole_bridge.so] Error 1 make[1]: *** [CMakeFiles/Makefile2:73: CMakeFiles/console_bridge.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... make[2]: *** Deleting file 'test/CMakeFiles/gtest.dir/gtest/src/gtest-all.cc.obj' make[2]: unlink: test/CMakeFiles/gtest.dir/gtest/src/gtest-all.cc.obj: Device or resource busy make[2]: *** [test/CMakeFiles/gtest.dir/build.make:63: test/CMakeFiles/gtest.dir/gtest/src/gtest-all.cc.obj] Interrupt make[1]: *** [CMakeFiles/Makefile2:208: test/CMakeFiles/gtest.dir/all] Interrupt make: *** [Makefile:141: all] Interrupt

Build broken on Windows

We're seeing a build failure in console_bridge on Windows (http://ci.ros2.org/job/packaging_windows/114/consoleFull#console-section-37):

ClCompile:
  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\CL.exe /c /I<http://ci.ros2.org/job/packaging_windows/ws/ws\src\vendor\console_bridge\include> /I<http://ci.ros2.org/job/packaging_windows/ws/ws\src\vendor\console_bridge\test\gtest\include> /I<http://ci.ros2.org/job/packaging_windows/ws/ws\src\vendor\console_bridge\test\gtest> /I<http://ci.ros2.org/job/packaging_windows/ws/ws\src\vendor\console_bridge\test> /nologo /W3 /WX- /O2 /Ob2 /D WIN32 /D _WINDOWS /D NDEBUG /D "CMAKE_INTDIR=\"Release\"" /D _MBCS /Gm- /EHsc /MD /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR /Fo"console_TEST.dir\Release\\" /Fd"console_TEST.dir\Release\vc140.pdb" /Gd /TP /errorReport:queue  -Wno-deprecated-declarations <http://ci.ros2.org/job/packaging_windows/ws/ws\src\vendor\console_bridge\test\console_TEST.cc>
cl : Command line error D8021: invalid numeric argument '/Wno-deprecated-declarations' [<http://ci.ros2.org/job/packaging_windows/ws/ws\build\console_bridge\test\console_TEST.vcxproj]>

I'm not an expert, but it looks like the MSVC compiler doesn't accept Wno-deprecated-declarations. It's not on their apparently exhaustive list: https://msdn.microsoft.com/en-us/library/fwkeyyhe.aspx.

Perhaps the setting of that option should be conditioned on platform so that it's not used on Windows: https://github.com/ros/console_bridge/blob/master/test/CMakeLists.txt#L26-L27.

problem about "logError or logWarn ...undeclared" is solved

add

#define logWarn CONSOLE_BRIDGE_logWarn
#define logError CONSOLE_BRIDGE_logError
#define logDebug CONSOLE_BRIDGE_logDebug
#define logInform CONSOLE_BRIDGE_logInform

to /usr/include/ros/console_bridge/console.h in some cases.

My OS: archlinux
lend my wisdom.

needs release which supports whitespaces in the path

The latest released version 0.2.3 fails when being build with spaces in the path.

Since the master has already been diverged I did not send those as a pull request. The following paths would need to be quoted:

The current master does not have a problem with spaces in the path but is not in a shape to be released as-is (imho #8 (comment)).

No package.xml

Is this package supposed to have a package.xml? It seems it was removed at tag 0.2.4, though groovy claims to be at version 0.2.4 yet it has a package.xml.

Anyway, we are building ROS from source and are currently patching this package; should we make a pull request? (Or, are we doing it wrong? :)

compiler warnings with Visual Studio 2017 due to gtest

E.g.:

console_bridge\test\gtest\include\gtest/gtest-printers.h(500):
warning C4996: 'std::tr1': warning STL4002:
The non-Standard std::tr1 namespace and TR1-only machinery are deprecated and will be REMOVED. You can define _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING to acknowledge that you have received this warning.

The warnings have been fixed upstream so pulling a newer version of the googletest code will likely solve this.

cmake config: console_bridge_LIBRARIES should contain absolute paths.

set(@PKG_NAME@_LIBRARIES @PKG_NAME@)

I'm trying to cross-compile console_bridge with catkin_make_isolated. Compiling it works fine, but when other packages try to link against console_bridge they can't find the library as console_bridge_LIBRARIES is only set to console_bridge.
e.g. in rosbag_storage:
https://github.com/ros/ros_comm/blob/kinetic-devel/tools/rosbag_storage/CMakeLists.txt#L41

I'm no cmake expert (so correct me if I'm wrong), but according to the documentation this variable should contain absolute paths to the library:

https://cmake.org/cmake/help/v3.10/command/link_directories.html:

Library locations returned by find_package() and find_library() are absolute paths. Pass these absolute library file paths directly to the target_link_libraries() command.

cannot print chinese by roslog

hi, there:
We found ROS cannot print Chinese by c++, like" 我是新手 ".
For instance, ROS_INFO(" 我是新手 "), the result is [ INFO] [1512552131.271037807]: ????????????
However, in python ROS could print Chinese well.
Is this issue caused by pointer?
like: const char* m in void console_bridge::log(const char file, int line, LogLevel level, const char m, ...)
@wjwwood

Boost error on OSX

I had to add "boost system" to get it to compile. Here is the diff:

[kevin@tardis console_bridge]$ git diff
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 453683d..09b7f61 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -5,7 +5,7 @@ if (NOT CMAKE_BUILD_TYPE)
   set(CMAKE_BUILD_TYPE Release)
 endif()

-find_package(Boost COMPONENTS thread REQUIRED)
+find_package(Boost COMPONENTS system thread REQUIRED)

 if(MSVC OR MSVC90 OR MSVC10)
   set(MSVC ON)
@@ -20,7 +20,7 @@ include_directories(${Boost_INCLUDE_DIR})
 link_directories(${Boost_LIBRARY_DIRS})

 add_library(${PROJECT_NAME} SHARED src/console.cpp)
-target_link_libraries(${PROJECT_NAME} ${Boost_THREAD_LIBRARY})
+target_link_libraries(${PROJECT_NAME} ${Boost_LIBRARIES})

 install(TARGETS ${PROJECT_NAME}
   DESTINATION lib/) 

Tests failing on windows

I had to disable the appveyor tests in 0d83ff0 since the test is failing via timeout. When I run it locally, it gives a pop-up saying that the console_bridge dll could not be found. I've tried to fix it scpeters@064642a, but it's not quite working yet.

console_bridgeConfig.cmake will not reroot its include directories in a crosscompilation build.

When building ROS in a cross-compiled build, console_bridgeConfig.cmake will set console_bridge_INCLUDE_DIRS to its installation include directory.
This will cause e.g. /usr/include to be added to the INCLUDE_DIRECTORIES, if the requiring package does not manually prefix the directories with the CMAKE_FIND_ROOT_PATH. As a result, builds might fail, e.g. because the hosts math.h is included which likely contains invalid ASM for the target system.
I am not sure about the convention in this regard, but looking at e.g. FindBoost.cmake they use find_path which returns the prefixed path.
I applied this patch in my case which fixes the issue:

diff --git a/console_bridge-config.cmake.in b/console_bridge-config.cmake.in
index 9d0763f..22ac756 100644
--- a/console_bridge-config.cmake.in
+++ b/console_bridge-config.cmake.in
@@ -3,7 +3,9 @@ if (@PKG_NAME@_CONFIG_INCLUDED)
 endif()
 set(@PKG_NAME@_CONFIG_INCLUDED TRUE)
 
-set(@PKG_NAME@_INCLUDE_DIRS "@CMAKE_INSTALL_FULL_INCLUDEDIR@")
+find_path(@PKG_NAME@_INCLDE_DIRS
+  NAMES console_bridge/console.h
+  HINTS @CMAKE_INSTALL_FULL_INCLUDE_DIR@)
 
 foreach(lib @PKG_LIBRARIES@)
   set(onelib "${lib}-NOTFOUND")

conflicting enums with syslog.h

In Groovy:

I'm writing a library that is including syslog.h via a 3rd-party library (MongoDB). When I attempt to export my library using Pluginlib (to use in RViz), I can't compile due to conflicting enums. See error output below:

In file included from /opt/ros/groovy/include/class_loader/class_loader.h:38:0,
from /opt/ros/groovy/include/pluginlib/class_list_macros.h:40,
from /home/dinh/ros_workspace/foobar/src/foo.cpp:157:
/opt/ros/groovy/include/console_bridge/console.h:81:5: error: expected identifier before numeric constant
/opt/ros/groovy/include/console_bridge/console.h:81:5: error: expected ‘}’ before numeric constant
/opt/ros/groovy/include/console_bridge/console.h:81:5: error: expected unqualified-id before numeric constant

LOG_DEBUG and LOG_INFO both conflict with names in syslog.h. If I change the enums in console_bridge/console.h to differ from those in syslog.h, everything compiles fine.

There are no issues in Fuerte. This issue could be showing up now due to the change in Pluginlib / introduction of the ClassLoader package in Groovy and it's possible that I'm incorrectly using Pluginlib with the new changes. Nevertheless, I suggest a change in the enums in order to reduce any potential conflicts.

update the repository to reflect the current state

The state of this repository has diverged significantly from what is actually being used / has been released latest. Currently it is not clear where future patches should be applied and how they could be released:

To match user expectation I think the repo needs some clean up:

  • remove the indigo-devel branch since that is not the console_bridge version being used by ROS Indigo
  • update master to reflect what could be the next version being released:
    • it should contain the content which future versions of console bridge could be tagged from
    • if the master is not compatible with the Ubuntu package (breaking API / ABI) I think it should be made clear by bumping the version number accordingly
    • if the master is not compatible with ROS Hydro anymore I think a hydro-devel branch should be created from the version being used in Hydro (plus optionally any non-breaking patches which should go into a potential patch release into Hydro)

(The general rules apply that no version number should ever be reused or be available from different branches containing different code.)

Forcing SHARED seems to have masked some issues

Potentially a missing -fPIC in the compile arguments. I guess because it's not catkin it doesn't default to SHARED. Do we wnat to implement

Anything building on top of console_bridge is failing, like class_loader: http://jenkins.willowgarage.com:8080/view/HbinP64/job/ros-hydro-class-loader_binarydeb_precise_amd64/7/console

make[2]: Entering directory `/tmp/buildd/ros-hydro-class-loader-0.2.1-0precise-20130619-0203/obj-x86_64-linux-gnu'
/usr/bin/cmake -H/tmp/buildd/ros-hydro-class-loader-0.2.1-0precise-20130619-0203 -B/tmp/buildd/ros-hydro-class-loader-0.2.1-0precise-20130619-0203/obj-x86_64-linux-gnu --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /tmp/buildd/ros-hydro-class-loader-0.2.1-0precise-20130619-0203/obj-x86_64-linux-gnu/CMakeFiles /tmp/buildd/ros-hydro-class-loader-0.2.1-0precise-20130619-0203/obj-x86_64-linux-gnu/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[3]: Entering directory `/tmp/buildd/ros-hydro-class-loader-0.2.1-0precise-20130619-0203/obj-x86_64-linux-gnu'
make -f CMakeFiles/class_loader.dir/build.make CMakeFiles/class_loader.dir/depend
make[4]: Entering directory `/tmp/buildd/ros-hydro-class-loader-0.2.1-0precise-20130619-0203/obj-x86_64-linux-gnu'
cd /tmp/buildd/ros-hydro-class-loader-0.2.1-0precise-20130619-0203/obj-x86_64-linux-gnu && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /tmp/buildd/ros-hydro-class-loader-0.2.1-0precise-20130619-0203 /tmp/buildd/ros-hydro-class-loader-0.2.1-0precise-20130619-0203 /tmp/buildd/ros-hydro-class-loader-0.2.1-0precise-20130619-0203/obj-x86_64-linux-gnu /tmp/buildd/ros-hydro-class-loader-0.2.1-0precise-20130619-0203/obj-x86_64-linux-gnu /tmp/buildd/ros-hydro-class-loader-0.2.1-0precise-20130619-0203/obj-x86_64-linux-gnu/CMakeFiles/class_loader.dir/DependInfo.cmake --color=
Scanning dependencies of target class_loader
make[4]: Leaving directory `/tmp/buildd/ros-hydro-class-loader-0.2.1-0precise-20130619-0203/obj-x86_64-linux-gnu'
make -f CMakeFiles/class_loader.dir/build.make CMakeFiles/class_loader.dir/build
make[4]: Entering directory `/tmp/buildd/ros-hydro-class-loader-0.2.1-0precise-20130619-0203/obj-x86_64-linux-gnu'
/usr/bin/cmake -E cmake_progress_report /tmp/buildd/ros-hydro-class-loader-0.2.1-0precise-20130619-0203/obj-x86_64-linux-gnu/CMakeFiles 1
[ 25%] Building CXX object CMakeFiles/class_loader.dir/src/class_loader.cpp.o
/usr/lib/ccache/c++   -Dclass_loader_EXPORTS -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security  -fPIC -I/tmp/buildd/ros-hydro-class-loader-0.2.1-0precise-20130619-0203/include -I/opt/ros/hydro/include    -o CMakeFiles/class_loader.dir/src/class_loader.cpp.o -c /tmp/buildd/ros-hydro-class-loader-0.2.1-0precise-20130619-0203/src/class_loader.cpp
/usr/bin/cmake -E cmake_progress_report /tmp/buildd/ros-hydro-class-loader-0.2.1-0precise-20130619-0203/obj-x86_64-linux-gnu/CMakeFiles 2
[ 50%] Building CXX object CMakeFiles/class_loader.dir/src/class_loader_core.cpp.o
/usr/lib/ccache/c++   -Dclass_loader_EXPORTS -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security  -fPIC -I/tmp/buildd/ros-hydro-class-loader-0.2.1-0precise-20130619-0203/include -I/opt/ros/hydro/include    -o CMakeFiles/class_loader.dir/src/class_loader_core.cpp.o -c /tmp/buildd/ros-hydro-class-loader-0.2.1-0precise-20130619-0203/src/class_loader_core.cpp
/usr/bin/cmake -E cmake_progress_report /tmp/buildd/ros-hydro-class-loader-0.2.1-0precise-20130619-0203/obj-x86_64-linux-gnu/CMakeFiles 3
[ 75%] Building CXX object CMakeFiles/class_loader.dir/src/meta_object.cpp.o
/usr/lib/ccache/c++   -Dclass_loader_EXPORTS -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security  -fPIC -I/tmp/buildd/ros-hydro-class-loader-0.2.1-0precise-20130619-0203/include -I/opt/ros/hydro/include    -o CMakeFiles/class_loader.dir/src/meta_object.cpp.o -c /tmp/buildd/ros-hydro-class-loader-0.2.1-0precise-20130619-0203/src/meta_object.cpp
/usr/bin/cmake -E cmake_progress_report /tmp/buildd/ros-hydro-class-loader-0.2.1-0precise-20130619-0203/obj-x86_64-linux-gnu/CMakeFiles 4
[100%] Building CXX object CMakeFiles/class_loader.dir/src/multi_library_class_loader.cpp.o
/usr/lib/ccache/c++   -Dclass_loader_EXPORTS -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security  -fPIC -I/tmp/buildd/ros-hydro-class-loader-0.2.1-0precise-20130619-0203/include -I/opt/ros/hydro/include    -o CMakeFiles/class_loader.dir/src/multi_library_class_loader.cpp.o -c /tmp/buildd/ros-hydro-class-loader-0.2.1-0precise-20130619-0203/src/multi_library_class_loader.cpp
Linking CXX shared library devel/lib/libclass_loader.so
/usr/bin/cmake -E cmake_link_script CMakeFiles/class_loader.dir/link.txt --verbose=1
/usr/lib/ccache/c++  -fPIC -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security    -shared -Wl,-soname,libclass_loader.so -o devel/lib/libclass_loader.so CMakeFiles/class_loader.dir/src/class_loader.cpp.o CMakeFiles/class_loader.dir/src/class_loader_core.cpp.o CMakeFiles/class_loader.dir/src/meta_object.cpp.o CMakeFiles/class_loader.dir/src/multi_library_class_loader.cpp.o -lboost_thread-mt -lpthread /opt/ros/hydro/lib/libconsole_bridge.a -lPocoFoundation -ldl 
/usr/bin/ld: /opt/ros/hydro/lib/libconsole_bridge.a(console.cpp.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/opt/ros/hydro/lib/libconsole_bridge.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[4]: *** [devel/lib/libclass_loader.so] Error 1

Cmakelist modification

change

  • configure_file("${cmake_conf_file}.in" "${CMAKE_BINARY_DIR}/${cmake_conf_file}" @only)
  • install(FILES ${CMAKE_BINARY_DIR}/${cmake_conf_file}

to

  • configure_file("${cmake_conf_file}.in" "${cmake_conf_file}" @only)
  • install(FILES ${cmake_conf_file}

Cmakelist.txt Line 49-50

errors in instructions on install of console_bridge

On answers.ros.org and this post (http://answers.ros.org/question/62215/where-to-install-console_bridge/) there are errors in the instructions:

Edit: mkdir cb_ws
cd cb_ws
git clone https://github.com/ros/console_bridge
cd cb_ws
mkdir build
cd build
cmake -CMAKE_INSTALL_PREFIX=../install ../console_bridge
make install

From the wiki (http://www.ros.org/wiki/console_bridge) the build instructions hint at some possible corrections but please review and correct as needed:

Edit: mkdir cb_ws
cd cb_ws
git clone https://github.com/ros/console_bridge (from the wiki should there be a .git at the end here)??
cd cb_ws (from the wiki should this be cd console_bridge)??
mkdir build (Here you use build but below you speak of install. Should we mkdir install instead of build)??
cd build
cmake -CMAKE_INSTALL_PREFIX=../install ../console_bridge (I've tried this line with the directory above as build and install and this cmake throws errors)??
make install (I never get this far because the cmake above fails)

I would appreciate any edits here to clear this up.

API breakage in new version (0.3)

Hi,

the new version breaks the API:

/<<PKGBUILDDIR>>/tools/rosbag_storage/src/bz2_stream.cpp: In member function 'virtual void rosbag::BZ2Stream::read(void*, size_t)':
/<<PKGBUILDDIR>>/tools/rosbag_storage/src/bz2_stream.cpp:119:9: error: 'else' without a previous 'if'
         else {
         ^
/<<PKGBUILDDIR>>/tools/rosbag_storage/src/lz4_stream.cpp: In member function 'virtual void rosbag::LZ4Stream::read(void*, size_t)':
/<<PKGBUILDDIR>>/tools/rosbag_storage/src/lz4_stream.cpp:159:9: error: 'else' without a previous 'if'
         else {
         ^
tools/rosbag_storage/CMakeFiles/rosbag_storage.dir/build.make:137: recipe for target 'tools/rosbag_storage/CMakeFiles/rosbag_storage.dir/src/bz2_stream.cpp.o' failed
make[3]: *** [tools/rosbag_storage/CMakeFiles/rosbag_storage.dir/src/bz2_stream.cpp.o] Error 1
make[3]: *** Waiting for unfinished jobs....

The problematic commit is 4c529c6.

The problem is that the console_bridge_deprecated(); makes the macro two commands and so the binding between the if and the else is lost (see https://github.com/ros/ros_comm/blob/indigo-devel/tools/rosbag_storage/src/bz2_stream.cpp#L118).

Build errors

Platform: Windows 10 1803
Built with VS 2017

Command line warning D9002: ignoring unknown option '-fvisibility=hidden'

error C2065: 'deprecated': undeclared identifier
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
error C2448: 'attribute': function-style initializer appears to be a function definition

CMakeError.log

add path to find_library check

If console_bridge is installed in odd (non-system) places, I am getting this error:

Re-run cmake no build system arguments
-- urdfdom version 0.2.9
-- Looking for libtinyxml - found
CMake Error at /home/hsu/projects/console_bridge/install_release/share/console_bridge/cmake/console_bridge-config.cmake:12 (message):
  Library 'console_bridge' in package console_bridge is not installed
  properly
Call Stack (most recent call first):
  CMakeLists.txt:42 (find_package)


-- Configuring incomplete, errors occurred!

Use c++11 instead of boost

This package uses just a very small amount of boost, much less than urdfdom (related issue: ros/urdfdom#62 ). So it should be easier to use this as a test case for how to start the move to c++11. I have made the necessary changes in scpeters@255abf6 but I wanted to wait before submitting a pull request to ask what the new branch should be called and what numbering to use.

Some questions:

  • Should this involve a major version bump to 1.0?
  • Should the current code that uses boost get moved to a release branch (i.e. release-0.2) and make the master branch use c++11?

@wjwwood

Progress toward Quality Level 1

This issue tracks the progression of libconsole-bridge-dev to Quality Level 1 and a 1.0 version level. It will follow the outline described in REP 2004.

  • Version Policy
    • Follows ROS Core Quality Declaration
  • Version >= 1.0.0
  • Change Control Process
  • API and ABI stability within a ROS distribution
  • Vulnerability Disclosure Policy

Documentation

  • Per-feature documentation.
  • Per-item documentation in public API.
    • Uses docblocks
  • Declared set of licenses
  • Copyright statement in each source file
    • Checked manually. New source files will require having one.
  • Quality Declaration document

Testing:

  • System tests, which cover "features"
  • Tests covering public API
  • Code Coverage > 95%:
      • Must have code coverage tracking for the package -> here
      • Must have and enforce a code coverage policy for new changes Policy
  • Performance tests: not currently available.
  • Linters and Static Analysis:
      • Must have a code style and enforce it.
      • Must use static analysis tools where applicable:
        -- cppcheck and cpplint

Dependencies:

  • Runtime "ROS" dependencies are level 1
    • None
  • non-ROS dependencies are equivalent level 1
    • None

Platform Support

  • Supports all tier 1 platforms as described in REP-2000

change naming of defines to include namespace

The currently defined macros to log messages (e.g.

#define logWarn(fmt, ...) console_bridge::log(__FILE__, __LINE__, console_bridge::CONSOLE_BRIDGE_LOG_WARN, fmt, ##__VA_ARGS__)
) are much to generic and collide with existing code. The should be prefixed with the package name to make them unique.

Even if this is a significant API change this should be fixed. Likely bumping more then just the patch version number.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.