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

Add bw-compatibility to simple_message ifdefs #275

Merged
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions simple_message/include/simple_message/log_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
#ifndef LOG_WRAPPER_H_
#define LOG_WRAPPER_H_

#ifdef SIMPLE_MESSAGE_USE_ROS
// remove ROS after Melodic (bw compat for #262)
#if defined(SIMPLE_MESSAGE_USE_ROS) || defined(ROS)
#include "ros/ros.h"
#endif

Expand All @@ -55,7 +56,8 @@ namespace log_wrapper


// Define ROS if this library will execute under ROS
#ifdef SIMPLE_MESSAGE_USE_ROS
// remove ROS after Melodic (bw compat for #262)
#if defined(SIMPLE_MESSAGE_USE_ROS) || defined(ROS)

// The LOG_COMM redirects to debug in ROS because ROS has
// debug filtering tools that allow the communications messages
Expand Down
6 changes: 4 additions & 2 deletions simple_message/include/simple_message/robot_status.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ enum RobotMode
MANUAL = 1, AUTO = 2,
};

#ifdef SIMPLE_MESSAGE_USE_ROS
// remove ROS after Melodic (bw compat for #262)
#if defined(SIMPLE_MESSAGE_USE_ROS) || defined(ROS)
int toROSMsgEnum(RobotModes::RobotMode mode);
#endif

Expand All @@ -85,7 +86,8 @@ enum TriState
TS_FALSE = 0, TS_OFF = 0, TS_DISABLED = 0, TS_LOW = 0
};

#ifdef SIMPLE_MESSAGE_USE_ROS
// remove ROS after Melodic (bw compat for #262)
#if defined(SIMPLE_MESSAGE_USE_ROS) || defined(ROS)
int toROSMsgEnum(TriStates::TriState state);
#endif

Expand Down
3 changes: 2 additions & 1 deletion simple_message/include/simple_message/socket/simple_socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
#include "smpl_msg_connection.h"
#endif

#ifdef SIMPLE_MESSAGE_LINUX
// remove LINUXSOCKETS after Melodic (bw compat for #262)
#if defined(SIMPLE_MESSAGE_LINUX) || defined(LINUXSOCKETS)

#ifndef _WIN32
#include "sys/socket.h"
Expand Down
3 changes: 2 additions & 1 deletion simple_message/include/simple_message/socket/tcp_socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
#include "shared_types.h"
#endif

#ifdef SIMPLE_MESSAGE_LINUX
// remove LINUXSOCKETS after Melodic (bw compat for #262)
#if defined(SIMPLE_MESSAGE_LINUX) || defined(LINUXSOCKETS)
#ifndef WIN32
#include "sys/socket.h"
#include "netdb.h"
Expand Down
3 changes: 2 additions & 1 deletion simple_message/include/simple_message/socket/udp_socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
#include "smpl_msg_connection.h"
#endif

#ifdef SIMPLE_MESSAGE_LINUX
// remove LINUXSOCKETS after Melodic (bw compat for #262)
#if defined(SIMPLE_MESSAGE_LINUX) || defined(LINUXSOCKETS)
#ifndef WIN32
#include "sys/socket.h"
#include "netdb.h"
Expand Down
6 changes: 4 additions & 2 deletions simple_message/src/message_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
#include "simple_message.h"
#endif

#ifdef SIMPLE_MESSAGE_USE_ROS
// remove ROS after Melodic (bw compat for #262)
#if defined(SIMPLE_MESSAGE_USE_ROS) || defined(ROS)
#include "ros/ros.h"
#else
#include "unistd.h"
Expand Down Expand Up @@ -187,7 +188,8 @@ void mySleep(int sec)
void MessageManager::spin()
{
LOG_INFO("Entering message manager spin loop");
#ifdef SIMPLE_MESSAGE_USE_ROS
// remove ROS after Melodic (bw compat for #262)
#if defined(SIMPLE_MESSAGE_USE_ROS) || defined(ROS)
while (ros::ok())
#else
while (true)
Expand Down
9 changes: 6 additions & 3 deletions simple_message/src/robot_status.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
#include "log_wrapper.h"
#endif

#ifdef SIMPLE_MESSAGE_USE_ROS
// remove ROS after Melodic (bw compat for #262)
#if defined(SIMPLE_MESSAGE_USE_ROS) || defined(ROS)
// Files below used to translate between ROS messages enums and
// enums defined in this file
#include "industrial_msgs/RobotMode.h"
Expand All @@ -55,7 +56,8 @@ namespace robot_status
namespace RobotModes
{

#ifdef SIMPLE_MESSAGE_USE_ROS
// remove ROS after Melodic (bw compat for #262)
#if defined(SIMPLE_MESSAGE_USE_ROS) || defined(ROS)

int toROSMsgEnum(RobotModes::RobotMode mode)
{
Expand Down Expand Up @@ -83,7 +85,8 @@ int toROSMsgEnum(RobotModes::RobotMode mode)
namespace TriStates
{

#ifdef SIMPLE_MESSAGE_USE_ROS
// remove ROS after Melodic (bw compat for #262)
#if defined(SIMPLE_MESSAGE_USE_ROS) || defined(ROS)

int toROSMsgEnum(TriStates::TriState state)
{
Expand Down