Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Romea #19

Open
wants to merge 5 commits into
base: ros2_0_foxy
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 11 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,18 @@ add_executable(
src/xdacallback.cpp
)

add_custom_command(
TARGET xsens_mti_node
PRE_LINK
COMMAND make
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib/xspublic
)

target_include_directories(xsens_mti_node PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/lib/xspublic>
$<INSTALL_INTERFACE:include>)

ament_target_dependencies(xsens_mti_node
ament_target_dependencies(xsens_mti_node
rclcpp
tf2
tf2_ros
Expand All @@ -60,6 +67,9 @@ install(DIRECTORY launch param rviz urdf
DESTINATION share/${PROJECT_NAME}
)

ament_environment_hooks("${CMAKE_CURRENT_SOURCE_DIR}/env-hooks/${PROJECT_NAME}.dsv.in")


if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
# the following line skips the linter which checks for copyrights
Expand Down
10 changes: 5 additions & 5 deletions README.txt
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
=[ Xsens MTi driver for ROS 2.0]============================================================

Documentation:
You can find the full documentation in "<your MT SDK directory>/doc/xsensdeviceapi/doc/html/index.html" under "ROS MTi driver" section. The SDK can be downloaded from https://www.xsens.com/software-downloads. Please note, this is a 3rd Party driver with no official support. Check the compatibility section for the compatible devices. For official support on Xsens MTi products, please refer to Xsens knowledge base: https://base.xsens.com
You can find the full documentation in "<your MT SDK directory>/doc/xsensdeviceapi/doc/html/index.html" under "ROS MTi driver" section. The SDK can be downloaded from https://www.xsens.com/software-downloads. Please note, this is a 3rd Party driver built from MTSDK2021.2 with no official support. Check the compatibility section for the compatible devices. For official support on Xsens MTi products, please refer to Xsens knowledge base: https://base.xsens.com

Prerequisites:
- ROS 2.0 Foxy
- ROS 2.0 Galactic/Foxy
- C/C++ Compiler: GCC 5.4.0 or MSVC 14.0
- C++14

Building:
- Copy bluespace_ai_xsens_mti_driver folder into your ROS 2.0 workspace 'src' folder.
Make sure the permissions are set to o+rw on your files and directories.

- Build xspublic from your ament workspace:
$ pushd src/bluespace_ai_xsens_ros_mti_driver/lib/xspublic && make && popd

- Build Xsens MTi driver package:
$ colcon build

- Source workspace:
$ source install/setup.bash

Note: Building of 'xspublic' from the ament workspace has been automated in the CMake script. To build it manually, run the following from the ROS2.0 workspace root:
$ pushd src/bluespace_ai_xsens_ros_mti_driver/lib/xspublic && make && popd

Changes in this release compared to the Xsens ROS 1.0 driver open source:
- Added ROS 2.0 support: The ROS 1.0 wrapper node was modified to work with ROS 2.0.
- Migration to declared configuration parameters: ROS 1.0 driver supported undeclared parameters. Since ROS 2.0 guidelines discourage undeclared parameters, there are some minor modifications in the xsens_mti_node.yaml to support all the configuration capabilities from ROS1.0. For more details check the config file.
Expand Down
1 change: 1 addition & 0 deletions env-hooks/bluespace_ai_xsens_mti_driver.dsv.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
prepend-non-duplicate;GAZEBO_MODEL_PATH;share
11 changes: 6 additions & 5 deletions lib/xspublic/xscommon/abstractadditionallogger.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// Copyright (c) 2003-2020 Xsens Technologies B.V. or subsidiaries worldwide.
// Copyright (c) 2003-2021 Xsens Technologies B.V. or subsidiaries worldwide.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
Expand Down Expand Up @@ -31,7 +31,7 @@
//


// Copyright (c) 2003-2020 Xsens Technologies B.V. or subsidiaries worldwide.
// Copyright (c) 2003-2021 Xsens Technologies B.V. or subsidiaries worldwide.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
Expand Down Expand Up @@ -71,7 +71,8 @@
/*! \class AbstractAdditionalLogger
Interface for all additional loggers that can be attached to the Journaller
*/
class AbstractAdditionalLogger {
class AbstractAdditionalLogger
{
public:
/*! \brief Destructor */
virtual ~AbstractAdditionalLogger() {}
Expand Down Expand Up @@ -106,7 +107,7 @@ class AbstractAdditionalLogger {
\param[in] function The name of the function from which the logging originates
\param[in] msg The actual log message
*/
virtual void log(JournalLogLevel level, char const * file, int line, char const * function, std::string const & msg) = 0;
virtual void log(JournalLogLevel level, char const* file, int line, char const* function, std::string const& msg) = 0;

/*! \brief Write line to the log without decoration (timestamp, thread)
\param[in] level The log level
Expand All @@ -115,7 +116,7 @@ class AbstractAdditionalLogger {
\param[in] function The name of the function from which the logging originates
\param[in] msg The actual log message
*/
virtual void logNoDecoration(JournalLogLevel level, char const * file, int line, char const * function, std::string const & msg) = 0;
virtual void logNoDecoration(JournalLogLevel level, char const* file, int line, char const* function, std::string const& msg) = 0;
};

#endif
6 changes: 3 additions & 3 deletions lib/xspublic/xscommon/additionalloggerbase.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// Copyright (c) 2003-2020 Xsens Technologies B.V. or subsidiaries worldwide.
// Copyright (c) 2003-2021 Xsens Technologies B.V. or subsidiaries worldwide.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
Expand Down Expand Up @@ -31,7 +31,7 @@
//


// Copyright (c) 2003-2020 Xsens Technologies B.V. or subsidiaries worldwide.
// Copyright (c) 2003-2021 Xsens Technologies B.V. or subsidiaries worldwide.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
Expand Down Expand Up @@ -138,7 +138,7 @@ bool AdditionalLoggerBase::logLevel(JournalLogLevel level) const
/*! \copydoc AbstractAdditionalLogger::logNoDecoration
The AdditionalLoggerBase simply forwards this call to the normal log method but this method can be overridden in derived classes
*/
void AdditionalLoggerBase::logNoDecoration(JournalLogLevel level, char const * file, int line, char const * function, std::string const & msg)
void AdditionalLoggerBase::logNoDecoration(JournalLogLevel level, char const* file, int line, char const* function, std::string const& msg)
{
log(level, file, line, function, msg);
}
6 changes: 3 additions & 3 deletions lib/xspublic/xscommon/additionalloggerbase.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// Copyright (c) 2003-2020 Xsens Technologies B.V. or subsidiaries worldwide.
// Copyright (c) 2003-2021 Xsens Technologies B.V. or subsidiaries worldwide.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
Expand Down Expand Up @@ -31,7 +31,7 @@
//


// Copyright (c) 2003-2020 Xsens Technologies B.V. or subsidiaries worldwide.
// Copyright (c) 2003-2021 Xsens Technologies B.V. or subsidiaries worldwide.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
Expand Down Expand Up @@ -84,7 +84,7 @@ class AdditionalLoggerBase : public virtual AbstractAdditionalLogger

bool logLevel(JournalLogLevel level) const override;

void logNoDecoration(JournalLogLevel level, char const * file, int line, char const * function, std::string const & msg) override;
void logNoDecoration(JournalLogLevel level, char const* file, int line, char const* function, std::string const& msg) override;

protected:
virtual void onLogLevelChanged(JournalLogLevel newLevel, JournalLogLevel oldLevel);
Expand Down
11 changes: 6 additions & 5 deletions lib/xspublic/xscommon/calltracer.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// Copyright (c) 2003-2020 Xsens Technologies B.V. or subsidiaries worldwide.
// Copyright (c) 2003-2021 Xsens Technologies B.V. or subsidiaries worldwide.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
Expand Down Expand Up @@ -31,7 +31,7 @@
//


// Copyright (c) 2003-2020 Xsens Technologies B.V. or subsidiaries worldwide.
// Copyright (c) 2003-2021 Xsens Technologies B.V. or subsidiaries worldwide.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
Expand Down Expand Up @@ -63,9 +63,9 @@
//

#ifdef CALLTRACER_H
XSENS_COMPILER_WARNING("X0008", "calltracer.h should only be included ONCE and NEVER in a header file")
XSENS_COMPILER_WARNING("X0008", "calltracer.h should only be included ONCE and NEVER in a header file")
#else
#define CALLTRACER_H
#define CALLTRACER_H
#endif

//#define TRACECALLS // define before including this header file to enable semi-automatic calltracing
Expand All @@ -80,7 +80,8 @@ XSENS_COMPILER_WARNING("X0008", "calltracer.h should only be included ONCE and N
during creation and another one when it gets destroyed, if a minimum time has passed since
construction.
*/
class CallTracer {
class CallTracer
{
public:
Journaller* m_journal;
std::string m_msg;
Expand Down
42 changes: 21 additions & 21 deletions lib/xspublic/xscommon/common_qdebug.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// Copyright (c) 2003-2020 Xsens Technologies B.V. or subsidiaries worldwide.
// Copyright (c) 2003-2021 Xsens Technologies B.V. or subsidiaries worldwide.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
Expand Down Expand Up @@ -31,7 +31,7 @@
//


// Copyright (c) 2003-2020 Xsens Technologies B.V. or subsidiaries worldwide.
// Copyright (c) 2003-2021 Xsens Technologies B.V. or subsidiaries worldwide.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
Expand Down Expand Up @@ -66,29 +66,29 @@
#define COMMON_QDEBUG_H

#ifdef __cplusplus
#include <QDebug>
#include <QDebug>

#define EXT_DEBUG_BODY(msg) __FILE__ << "(" << __LINE__ << "):" << __FUNCTION__ << msg
#define EXT_DEBUG_BODY(msg) __FILE__ << "(" << __LINE__ << "):" << __FUNCTION__ << msg

#ifdef XSENS_RELEASE
#define QTRACE(msg) ((void)0)
#define QDEBUG(msg) ((void)0)
#define QDEBUG_ACCURATE(msg) ((void)0)
#else
// #ifdef NO_QTRACE
#ifdef XSENS_RELEASE
#define QTRACE(msg) ((void)0)
// #else
// #define QTRACE(msg) qDebug() << __FUNCTION__ << msg
// #endif
#define QDEBUG(msg) qDebug() << __FUNCTION__ << msg
#define QDEBUG(msg) ((void)0)
#define QDEBUG_ACCURATE(msg) ((void)0)
#else
// #ifdef NO_QTRACE
#define QTRACE(msg) ((void)0)
// #else
// #define QTRACE(msg) qDebug() << __FUNCTION__ << msg
// #endif
#define QDEBUG(msg) qDebug() << __FUNCTION__ << msg

// #include "xqtime.h"
// #define QDEBUG_ACCURATE(msg) qDebug() << xqLogTime() << __FUNCTION__ << msg
#endif // XSENS_RELEASE
// #include "xqtime.h"
// #define QDEBUG_ACCURATE(msg) qDebug() << xqLogTime() << __FUNCTION__ << msg
#endif // XSENS_RELEASE

#define QWARNING(msg) qWarning() << EXT_DEBUG_BODY(msg)
#define QCRITICAL(msg) qCritical() << EXT_DEBUG_BODY(msg)
#define QFATAL(msg) do not use this macro! qFatal has weird side-effects!
#define QWARNING(msg) qWarning() << EXT_DEBUG_BODY(msg)
#define QCRITICAL(msg) qCritical() << EXT_DEBUG_BODY(msg)
#define QFATAL(msg) do not use this macro! qFatal has weird side-effects!
#endif

#endif // file guard
#endif
12 changes: 6 additions & 6 deletions lib/xspublic/xscommon/consolelogger.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// Copyright (c) 2003-2020 Xsens Technologies B.V. or subsidiaries worldwide.
// Copyright (c) 2003-2021 Xsens Technologies B.V. or subsidiaries worldwide.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
Expand Down Expand Up @@ -31,7 +31,7 @@
//


// Copyright (c) 2003-2020 Xsens Technologies B.V. or subsidiaries worldwide.
// Copyright (c) 2003-2021 Xsens Technologies B.V. or subsidiaries worldwide.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
Expand Down Expand Up @@ -86,21 +86,21 @@ ConsoleLogger::ConsoleLogger(JournalLogLevel logLevel, JournalLogLevel errLevel)
\param[in] function The name of the function from which the logging originates
\param[in] msg The actual log message
*/
void ConsoleLogger::log(JournalLogLevel level, char const * file, int line, char const * function, std::string const & msg)
void ConsoleLogger::log(JournalLogLevel level, char const* file, int line, char const* function, std::string const& msg)
{
(void)file;
(void)line;
// get just the function name
size_t p = strlen(function);
while (p > 0)
{
if (function[p-1] == ':')
if (function[p - 1] == ':')
break;
--p;
}

if (level >= logLevel())
std::cout << function+p << ": " << msg << std::endl;
std::cout << function + p << ": " << msg << std::endl;
if (level >= debugLevel())
std::cerr << function+p << ": " << msg << std::endl;
std::cerr << function + p << ": " << msg << std::endl;
}
6 changes: 3 additions & 3 deletions lib/xspublic/xscommon/consolelogger.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// Copyright (c) 2003-2020 Xsens Technologies B.V. or subsidiaries worldwide.
// Copyright (c) 2003-2021 Xsens Technologies B.V. or subsidiaries worldwide.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
Expand Down Expand Up @@ -31,7 +31,7 @@
//


// Copyright (c) 2003-2020 Xsens Technologies B.V. or subsidiaries worldwide.
// Copyright (c) 2003-2021 Xsens Technologies B.V. or subsidiaries worldwide.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
Expand Down Expand Up @@ -72,7 +72,7 @@ class ConsoleLogger : public AdditionalLoggerBase
public:
ConsoleLogger(JournalLogLevel logLevel, JournalLogLevel errLevel);

void log(JournalLogLevel level, char const * file, int line, char const * function, std::string const & msg) override;
void log(JournalLogLevel level, char const* file, int line, char const* function, std::string const& msg) override;
};

#endif
Loading