Skip to content
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
4 changes: 1 addition & 3 deletions ign_migration_scripts/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ find_package(catkin REQUIRED)

catkin_package()

catkin_add_env_hooks(ign SHELLS bash
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/env-hooks)
catkin_add_env_hooks(ign SHELLS zsh
catkin_add_env_hooks(29.ign_migration_scripts SHELLS bash zsh
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/env-hooks)
install(DIRECTORY launch
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Export Ignition environment variables

@[if INSTALLSPACE]@
export IGN_LAUNCH_CONFIG_PATH=@(CMAKE_INSTALL_PREFIX)/@(CATKIN_PACKAGE_SHARE_DESTINATION)/launch
export IGN_GAZEBO_RESOURCE_PATH=@(CMAKE_INSTALL_PREFIX)/@(CATKIN_PACKAGE_SHARE_DESTINATION)/worlds:${IGN_GAZEBO_RESOURCE_PATH}
@[else]@
export IGN_LAUNCH_CONFIG_PATH=@(CMAKE_CURRENT_SOURCE_DIR)/launch
export IGN_GAZEBO_RESOURCE_PATH=@(CMAKE_CURRENT_SOURCE_DIR)/worlds:${IGN_GAZEBO_RESOURCE_PATH}
@[end if]@
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Export Ignition environment variables

@[if INSTALLSPACE]@
export IGN_LAUNCH_CONFIG_PATH=@(CMAKE_INSTALL_PREFIX)/@(CATKIN_PACKAGE_SHARE_DESTINATION)/launch
export IGN_GAZEBO_RESOURCE_PATH=@(CMAKE_INSTALL_PREFIX)/@(CATKIN_PACKAGE_SHARE_DESTINATION)/worlds:${IGN_GAZEBO_RESOURCE_PATH}
@[else]@
export IGN_LAUNCH_CONFIG_PATH=@(CMAKE_CURRENT_SOURCE_DIR)/launch
export IGN_GAZEBO_RESOURCE_PATH=@(CMAKE_CURRENT_SOURCE_DIR)/worlds:${IGN_GAZEBO_RESOURCE_PATH}
@[end if]@
6 changes: 0 additions & 6 deletions ign_migration_scripts/env-hooks/ign.bash.in

This file was deleted.

6 changes: 0 additions & 6 deletions ign_migration_scripts/env-hooks/ign.zsh.in

This file was deleted.

7 changes: 4 additions & 3 deletions subt_ign/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ set (SUBT_VERSION_FULL

find_package(catkin REQUIRED
COMPONENTS
roslib
rostest
subt_rf_interface
subt_communication_model
Expand Down Expand Up @@ -52,6 +53,7 @@ include_directories(
include
${catkin_INCLUDE_DIRS}
${PROJECT_BINARY_DIR}/include
${CATKIN_DEVEL_PREFIX}/include
)

catkin_package(
Expand All @@ -61,6 +63,7 @@ catkin_package(
subt_communication_broker
INCLUDE_DIRS
include
${CATKIN_DEVEL_PREFIX}/include
LIBRARIES
SubtProtobuf
CFG_EXTRAS
Expand Down Expand Up @@ -88,9 +91,7 @@ install(DIRECTORY ${CATKIN_DEVEL_PREFIX}/include/${PROJECT_NAME}/protobuf/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}/protobuf
FILES_MATCHING PATTERN "*.h")

catkin_add_env_hooks(ign SHELLS bash
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/env-hooks)
catkin_add_env_hooks(ign SHELLS zsh
catkin_add_env_hooks(30.subt_ign SHELLS bash zsh
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/env-hooks)

add_library(SubtCommon
Expand Down
15 changes: 15 additions & 0 deletions subt_ign/env-hooks/30.subt_ign.bash.em
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Export Ignition environment variables

@[if INSTALLSPACE]@
export IGN_LAUNCH_CONFIG_PATH=@(CMAKE_INSTALL_PREFIX)/@(CATKIN_PACKAGE_SHARE_DESTINATION)/launch
export IGN_LAUNCH_PLUGIN_PATH=@(CMAKE_INSTALL_PREFIX)/@(CATKIN_PACKAGE_LIB_DESTINATION):${IGN_LAUNCH_PLUGIN_PATH}
export IGN_GAZEBO_RESOURCE_PATH=@(CMAKE_INSTALL_PREFIX)/@(CATKIN_PACKAGE_SHARE_DESTINATION)/worlds:${IGN_GAZEBO_RESOURCE_PATH}
export SUBT_IMAGES_PATH=@(CMAKE_INSTALL_PREFIX)/@(CATKIN_PACKAGE_SHARE_DESTINATION)/images
@[else]@
export IGN_LAUNCH_CONFIG_PATH=@(CMAKE_CURRENT_SOURCE_DIR)/launch
export IGN_LAUNCH_PLUGIN_PATH=@(CATKIN_DEVEL_PREFIX)/@(CATKIN_PACKAGE_LIB_DESTINATION):${IGN_LAUNCH_PLUGIN_PATH}
export IGN_GAZEBO_RESOURCE_PATH=@(CMAKE_CURRENT_SOURCE_DIR)/worlds:${IGN_GAZEBO_RESOURCE_PATH}
export SUBT_IMAGES_PATH=@(CMAKE_CURRENT_SOURCE_DIR)/images
@[end if]@

export IGN_TRANSPORT_TOPIC_STATISTICS=1
15 changes: 15 additions & 0 deletions subt_ign/env-hooks/30.subt_ign.zsh.em
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Export Ignition environment variables

@[if INSTALLSPACE]@
export IGN_LAUNCH_CONFIG_PATH=@(CMAKE_INSTALL_PREFIX)/@(CATKIN_PACKAGE_SHARE_DESTINATION)/launch
export IGN_LAUNCH_PLUGIN_PATH=@(CMAKE_INSTALL_PREFIX)/@(CATKIN_PACKAGE_LIB_DESTINATION)
export IGN_GAZEBO_RESOURCE_PATH=@(CMAKE_INSTALL_PREFIX)/@(CATKIN_PACKAGE_SHARE_DESTINATION)/worlds
export SUBT_IMAGES_PATH=@(CMAKE_INSTALL_PREFIX)/@(CATKIN_PACKAGE_SHARE_DESTINATION)/images
export IGN_TRANSPORT_TOPIC_STATISTICS=1
@[else]@
export IGN_LAUNCH_CONFIG_PATH=@(CMAKE_CURRENT_SOURCE_DIR)/launch
export IGN_LAUNCH_PLUGIN_PATH=@(CATKIN_DEVEL_PREFIX)/@(CATKIN_PACKAGE_LIB_DESTINATION)
export IGN_GAZEBO_RESOURCE_PATH=@(CMAKE_CURRENT_SOURCE_DIR)/worlds
export SUBT_IMAGES_PATH=@(CMAKE_CURRENT_SOURCE_DIR)/images
export IGN_TRANSPORT_TOPIC_STATISTICS=1
@[end if]@
7 changes: 0 additions & 7 deletions subt_ign/env-hooks/ign.bash.in

This file was deleted.

7 changes: 0 additions & 7 deletions subt_ign/env-hooks/ign.zsh.in

This file was deleted.

3 changes: 0 additions & 3 deletions subt_ign/include/subt_ign/Config.hh.in
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,4 @@

/* Config.hh. Generated by CMake for @PROJECT_NAME@. */

/* Directory where the world files are installed */
#define SUBT_INSTALL_WORLD_DIR "${CMAKE_INSTALL_PREFIX}/share/subt_ign/worlds"

#endif
1 change: 1 addition & 0 deletions subt_ign/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<depend>libccd-dev</depend>
<depend>libfcl-dev</depend>
<depend>rosbag</depend>
<depend>roslib</depend>

<test_depend>rostest</test_depend>
</package>
4 changes: 3 additions & 1 deletion subt_ign/src/Common.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <subt_ign/Common.hh>
#include <subt_ign/Config.hh>
#include <ignition/common/Util.hh>
#include <ros/package.h>

namespace subt
{
Expand Down Expand Up @@ -99,7 +100,8 @@ bool FullWorldPath(const std::string &_worldName,
return false;
}

std::string worldsDirectory = SUBT_INSTALL_WORLD_DIR;
std::string worldsDirectory = ignition::common::joinPaths(
ros::package::getPath("subt_ign"), "worlds");

const std::string tunnelPrefix = "tunnel_circuit_";
const std::string urbanPrefix = "urban_circuit_";
Expand Down
5 changes: 4 additions & 1 deletion subt_ign/src/ConnectionValidatorPrivate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,16 @@
#include <subt_ign/Config.hh>
#include <subt_ign/SimpleDOTParser.hh>

#include <ros/package.h>

using namespace subt;
using namespace ignition;

/////////////////////////////////////////////////
bool ConnectionValidatorPrivate::Load(const std::string &_worldName)
{
std::string worldsDirectory = SUBT_INSTALL_WORLD_DIR;
std::string worldsDirectory = ignition::common::joinPaths(
ros::package::getPath("subt_ign"), "worlds");

std::string fullPath;
subt::FullWorldPath(_worldName, fullPath);
Expand Down
41 changes: 25 additions & 16 deletions subt_ign/test/Common_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,21 @@

#include <gtest/gtest.h>

#include <ignition/common/Filesystem.hh>

#include <subt_ign/Config.hh>
#include <subt_ign/Common.hh>
#include <subt_ign/CommonTypes.hh>

#include <ros/package.h>

/////////////////////////////////////////////////
TEST(subt_ign_Common, ArtifactTypes){
// Tests to make sure all of our types are consistent
//
// It is expected that these tests will fail when artifacts
// are added or removed, and should be adjusted as such.
auto num_artifacts = static_cast<uint32_t>(subt::ArtifactType::Count);
auto num_artifacts = static_cast<uint32_t>(subt::ArtifactType::Count);
ASSERT_EQ(14u, num_artifacts);
ASSERT_EQ(num_artifacts, subt::kArtifactNames.size());
ASSERT_EQ(num_artifacts, subt::kArtifactTypes.size());
Expand Down Expand Up @@ -138,27 +143,31 @@ TEST(subt_ign_Common, StringFromArtifact) {
/////////////////////////////////////////////////
TEST(subt_ign_Common, FullWorldPath) {
std::vector<std::pair<std::string, std::string>> expected = {
{"simple_cave_01", "/simple_cave_01"},
{"cave_qual", "/cave_qual"},
{"cave_circuit_practice_01", "/cave_circuit_practice_01"},
{"cave_circuit_01", "/cave_circuit/01/cave_circuit_01"},

{"simple_tunnel_02", "/simple_tunnel_02"},
{"tunnel_circuit_practice_02", "/tunnel_circuit_practice_02"},
{"tunnel_qual_ign", "/tunnel_qual_ign"},
{"tunnel_circuit_02", "/tunnel_circuit/02/tunnel_circuit_02"},

{"simple_urban_03", "/simple_urban_03"},
{"urban_circuit_practice_03", "/urban_circuit_practice_03"},
{"urban_qual", "/urban_qual"},
{"urban_circuit_03", "/urban_circuit/03/urban_circuit_03"},
{"simple_cave_01", "simple_cave_01"},
{"cave_qual", "cave_qual"},
{"cave_circuit_practice_01", "cave_circuit_practice_01"},
{"cave_circuit_01", "cave_circuit/01/cave_circuit_01"},

{"simple_tunnel_02", "simple_tunnel_02"},
{"tunnel_circuit_practice_02", "tunnel_circuit_practice_02"},
{"tunnel_qual_ign", "tunnel_qual_ign"},
{"tunnel_circuit_02", "tunnel_circuit/02/tunnel_circuit_02"},

{"simple_urban_03", "simple_urban_03"},
{"urban_circuit_practice_03", "urban_circuit_practice_03"},
{"urban_qual", "urban_qual"},
{"urban_circuit_03", "urban_circuit/03/urban_circuit_03"},
};

std::string worldsDirectory = ignition::common::joinPaths(
ros::package::getPath("subt_ign"), "worlds");
for (const auto &[input, expected_out] : expected)
{
std::string worldPath;
EXPECT_TRUE(subt::FullWorldPath(input, worldPath));
EXPECT_EQ(expected_out, worldPath);
EXPECT_EQ(
ignition::common::joinPaths(worldsDirectory, expected_out),
worldPath);
}

{
Expand Down