Skip to content

Commit

Permalink
ros2GH-14 Add documentation about building the ros1 plugin on Mac
Browse files Browse the repository at this point in the history
  • Loading branch information
botteroa-si authored and Martin-Idel-SI committed Dec 13, 2018
1 parent 7e19a7d commit 28ceec8
Showing 1 changed file with 28 additions and 3 deletions.
31 changes: 28 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ $ colcon build --merge-install

The `--merge-install` flag is optional but ensures a cleaner environment which is helpful for development.

#### Executing tests
### Executing tests

The tests can be run using the following commands:

Expand All @@ -43,8 +43,9 @@ The first command executes the test and the second command displays the errors (
It is possible to read old bagfiles with `ros2`.
This requires translating ROS 1 messages into ROS 2 messages similar to the `ros1_bridge`.
If your rosbags contain custom message formats which can be translated into ROS 2 messages, the plugins need to be built from source.
In any case, the plugin needs to have ROS 1 installed on the system, so it is currently unavailable on Windows.

#### Building the plugins
### Building the plugins

You need to have the `ros1_bridge` built (see <https://index.ros.org/p/ros1_bridge/github-ros2-ros1_bridge/#bouncy>).

Expand All @@ -58,7 +59,7 @@ This will automatically match all ROS 1 messages to their ROS 2 counterpart usin

**N.B:** The ROS 1 installation must be sourced first to avoid problems with the `class_loader`.

#### Using the plugins
### Using the plugins

In order to use the plugins, again, the ROS 1 installation must be sourced **before** sourcing the ROS 2 installation.

Expand All @@ -77,3 +78,27 @@ ros2 bag play -s rosbag_v2 <path_to_bagfile>
```

Currently, split bagfiles are unsupported.

### Building the plugin on macOS

Since building the plugin requires ROS 1, which is only officially supported on Debian/Ubuntu, this plugin is also only officially supported on Linux.
However, if one has a working ROS1 installation on macOS, following the instructions above it should be possible to build and use the plugin on macOS as well.

##### Troubleshooting
When building the ROS1 plugin on macOS the following error may occur:
```
In file included from <path_to_ros>/install_isolated/include/roslz4/lz4s.h:38:
<path_to_lz4>/lz4.h:437:12: error: an attribute list cannot appear here
LZ4LIB_API LZ4_DEPRECATED("use LZ4_compress_default() instead") int LZ4_compress (const char* source, char* dest, int sourceSize);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/include/lz4.h:423:37: note: expanded from macro 'LZ4_DEPRECATED'
# define LZ4_DEPRECATED(message) [[deprecated(message)]]
^~~~~~~~~~~~~~~~~~~~~~~
```
This can be fixed by defining `LZ4_DISABLE_DEPRECATE_WARNINGS` before including `lz4` in `roslz4/lz4s.h`:
```
#define LZ4_DISABLE_DEPRECATE_WARNINGS
#include <lz4.h>
```

0 comments on commit 28ceec8

Please sign in to comment.