Commit 5d7f792c authored by David Daish's avatar David Daish

Changed join function from template, to overloaded func, split up plugin libraries

parent b226266e
......@@ -3,9 +3,10 @@ cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
find_package(gazebo REQUIRED)
include_directories(${GAZEBO_INCLUDE_DIRS})
link_directories(${GAZEBO_LIBRARY_DIRS})
list(APPEND CMAKE_CXX_FLAGS "${GAZEBO_CXX_FLAGS}")
list(APPEND CMAKE_CXX_FLAGS "${GAZEBO_CXX_FLAGS} -Wall")
add_library(PlankDrop SHARED plank_drop.cc extra_functions.h extra_functions.cc)
add_library(CamRecord SHARED cam_record.cc extra_functions.h extra_functions.cc)
add_library(PlankDrop SHARED plank_drop.cc extra_functions.cc)
add_library(CamRecord SHARED cam_record.cc extra_functions.cc)
target_link_libraries(PlankDrop CamRecord ${GAZEBO_LIBRARIES})
target_link_libraries(PlankDrop ${GAZEBO_LIBRARIES})
target_link_libraries(CamRecord ${GAZEBO_LIBRARIES})
......@@ -64,8 +64,7 @@ double cam_yaw (double cam_x, double cam_y)
}
// Joins a list of coordinates together, so they can be specified for the SDF pose
template <class T>
std::string join (std::list<T> cords, std::string join_str)
std::string join (std::list<double> cords, std::string join_str)
{
std::stringstream joined;
......@@ -78,3 +77,17 @@ std::string join (std::list<T> cords, std::string join_str)
return joined.str();
}
std::string join (std::list<std::string> cords, std::string join_str)
{
std::stringstream joined;
for (auto iter = cords.begin(); iter != cords.end(); iter++)
{
if (iter != cords.begin())
joined << join_str;
joined << *iter;
}
return joined.str();
}
......@@ -27,7 +27,7 @@ double cam_pitch ();
double cam_yaw (double cam_x, double cam_y);
// Joins a list of coordinates together, so they can be specified for the SDF pose
template <class T>
std::string join (std::list<T> cords, std::string join_str);
std::string join (std::list<double> cords, std::string join_str);
std::string join (std::list<std::string> cords, std::string join_str);
#endif
......@@ -10,6 +10,7 @@
#include "extra_functions.h"
//////////////////////////////////////////////////////////////
namespace gazebo
{
......
......@@ -21,6 +21,7 @@ docker build -t gazebo .
```
docker run -it --rm \
-e DISPLAY=$DISPLAY \
-v ~/Downloads/dataset:/mnt/dataset \
-v /tmp/.X11-unix:/tmp/.X11-unix:ro \
gazebo
```
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment