Commit aac9f244 authored by hazrmard's avatar hazrmard
Browse files

Gazebo Plugin repo from MATLAB

parents
Loading
Loading
Loading
Loading

CMakeLists.txt

0 → 100644
+68 −0
Changes for CMakeLists.txt: 68 added lines, 0 removed lines.
Original line number Diff line number Diff line
#/* Copyright 2019 The MathWorks, Inc. */
##########################################
# CMakeLists.txt for gazebo_plugin_for_simulink #
##########################################

cmake_minimum_required(VERSION 2.8)

PROJECT(gazebo_plugin_for_simulink)

#################################
# Specify the CMake module path #
#################################

SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}  -Wall  -O3 -march=native ")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall   -O3 -march=native")

# Check C++11 or C++0x support
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX11)
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
   add_definitions(-DCOMPILEDWITHC11)
   message(STATUS "Using flag -std=c++11.")
elseif(COMPILER_SUPPORTS_CXX0X)
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
   add_definitions(-DCOMPILEDWITHC0X)
   message(STATUS "Using flag -std=c++0x.")
else()
   message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
endif()
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -pthread")

IF(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libstdc++ -Wno-deprecated-declarations -Wno-unused-function")
ENDIF()

find_package(Boost 1.58.0 REQUIRED COMPONENTS date_time)
find_package(gazebo 9 REQUIRED)

include_directories(
include/
msgsproto/
${Boost_INCLUDE_DIR}
${GAZEBO_INCLUDE_DIRS}
)

link_directories(
  ${GAZEBO_LIBRARY_DIRS}
)

ADD_SUBDIRECTORY(msgsproto)
ADD_SUBDIRECTORY(src/transport)
ADD_SUBDIRECTORY(src/gazeboserver)
ADD_SUBDIRECTORY(src/gazeboplugin)

###############################################
# USE => cmake .. -DTESTING=ON  to trun ON testing

option(TESTING "plugin testing" OFF)

if(TESTING)
   ADD_SUBDIRECTORY(src/gazeboplugin/pkgtest)
   ADD_SUBDIRECTORY(src/gazeboserver/gazebomsghandler/pkgtest)
endif()

README.md

0 → 100644
+31 −0
Changes for README.md: 31 added lines, 0 removed lines.
Original line number Diff line number Diff line
# Gazebo Plugin

This repo contains source code (and pre-built libraries) for the gazebo plugin used for co-simulation with Matlab/simulink. The code was extracted from the virtual machine provided by Matlab.

* [Instructions to build](https://www.mathworks.com/help/robotics/examples/perform-co-simulation-between-simulink-and-gazebo.html)
* [Virtual machine link](https://www.mathworks.com/ros2_vm_install/v2)

## Build

The libraries in `GazeboPLugin/export/lib/` can be built again using:

```bash
git clone git@git.isis.vanderbilt.edu:ahmedi/GazeboPlugin.git
cd GazeboPlugin
mkdir build
cd build
cmake ..
make
```

This will create a plugin file in `GazeboPlugin/export/lib/libGazeboCoSimPlugin.so`. Add the path to `GAZEBO_PLUGIN_PATH` variable:

```
export GAZEBO_PLUGIN_PATH=GazeboPlugin/export/lib/:${GAZEBO_PLUGIN_PATH}
```

Then include the plugin in a `world` file for gazebo. The path should be relative to whatever path was added to the `GAZEBO_PLUGIN_PATH` variable.

```
<plugin name="GazeboPlugin" filename="libGazeboCoSimPlugin.so"><portNumber>14581</portNumber></plugin>
```

README.md~

0 → 100644
+29 −0
Changes for README.md~: 29 added lines, 0 removed lines.
Original line number Diff line number Diff line
# Gazebo Plugin

This repo contains source code for the gazebo plugin used for co-simulation with Matlab/simulink. The code was extracted from the virtual machine provided by Matlab.

* [Instructions to build](https://www.mathworks.com/help/robotics/examples/perform-co-simulation-between-simulink-and-gazebo.html)
* [Virtual machine link](https://www.mathworks.com/ros2_vm_install/v2)

## Build

```bash
git clone git@git.isis.vanderbilt.edu:ahmedi/GazeboPlugin.git
cd GazeboPlugin
mkdir build
cd build
cmake ..
make
```

This will create a plugin file in `GazeboPlugin/export/lib/libGazeboCoSimPlugin.so`. Add the path to `GAZEBO_PLUGIN_PATH` variable:

```
export GAZEBO_PLUGIN_PATH=GazeboPlugin/export/lib/:${GAZEBO_PLUGIN_PATH}
```

Then include the plugin in a `world` file for gazebo. The path should be relative to whatever path was added to the `GAZEBO_PLUGIN_PATH` variable.

```
<plugin name="GazeboPlugin" filename="libGazeboCoSimPlugin.so"><portNumber>14581</portNumber></plugin>
```

build/CMakeCache.txt

0 → 100644
+1588 −0

File added.

Preview size limit exceeded, changes collapsed.

+73 −0
Changes for build/CMakeFiles/3.10.2/CMakeCCompiler.cmake: 73 added lines, 0 removed lines.
Original line number Diff line number Diff line
set(CMAKE_C_COMPILER "/usr/bin/cc")
set(CMAKE_C_COMPILER_ARG1 "")
set(CMAKE_C_COMPILER_ID "GNU")
set(CMAKE_C_COMPILER_VERSION "7.4.0")
set(CMAKE_C_COMPILER_VERSION_INTERNAL "")
set(CMAKE_C_COMPILER_WRAPPER "")
set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "11")
set(CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert")
set(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes")
set(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros")
set(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert")

set(CMAKE_C_PLATFORM_ID "Linux")
set(CMAKE_C_SIMULATE_ID "")
set(CMAKE_C_SIMULATE_VERSION "")



set(CMAKE_AR "/usr/bin/ar")
set(CMAKE_C_COMPILER_AR "/usr/bin/gcc-ar-7")
set(CMAKE_RANLIB "/usr/bin/ranlib")
set(CMAKE_C_COMPILER_RANLIB "/usr/bin/gcc-ranlib-7")
set(CMAKE_LINKER "/usr/bin/ld")
set(CMAKE_COMPILER_IS_GNUCC 1)
set(CMAKE_C_COMPILER_LOADED 1)
set(CMAKE_C_COMPILER_WORKS TRUE)
set(CMAKE_C_ABI_COMPILED TRUE)
set(CMAKE_COMPILER_IS_MINGW )
set(CMAKE_COMPILER_IS_CYGWIN )
if(CMAKE_COMPILER_IS_CYGWIN)
  set(CYGWIN 1)
  set(UNIX 1)
endif()

set(CMAKE_C_COMPILER_ENV_VAR "CC")

if(CMAKE_COMPILER_IS_MINGW)
  set(MINGW 1)
endif()
set(CMAKE_C_COMPILER_ID_RUN 1)
set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m)
set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
set(CMAKE_C_LINKER_PREFERENCE 10)

# Save compiler ABI information.
set(CMAKE_C_SIZEOF_DATA_PTR "8")
set(CMAKE_C_COMPILER_ABI "ELF")
set(CMAKE_C_LIBRARY_ARCHITECTURE "x86_64-linux-gnu")

if(CMAKE_C_SIZEOF_DATA_PTR)
  set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}")
endif()

if(CMAKE_C_COMPILER_ABI)
  set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}")
endif()

if(CMAKE_C_LIBRARY_ARCHITECTURE)
  set(CMAKE_LIBRARY_ARCHITECTURE "x86_64-linux-gnu")
endif()

set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "")
if(CMAKE_C_CL_SHOWINCLUDES_PREFIX)
  set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}")
endif()





set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "gcc;gcc_s;c;gcc;gcc_s")
set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/x86_64-linux-gnu/7;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib")
set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "")
Loading