Easy Navigation
Toggle main menu visibility
Loading...
Searching...
No Matches
easynav_common
include
easynav_common
PackageShare.hpp
Go to the documentation of this file.
1
// Copyright 2026 Intelligent Robotics Lab
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14
17
18
#ifndef EASYNAV_COMMON__PACKAGESHARE_HPP_
19
#define EASYNAV_COMMON__PACKAGESHARE_HPP_
20
21
#include <filesystem>
22
#include <string>
23
24
// Humble only has get_package_share_directory(); Rolling only get_package_share_path()
25
#if __has_include("ament_index_cpp/get_package_share_path.hpp")
26
#include "ament_index_cpp/get_package_share_path.hpp"
27
#else
28
#include "ament_index_cpp/get_package_share_directory.hpp"
29
#endif
30
31
namespace
easynav
32
{
33
38
inline
std::filesystem::path
get_package_share_path
(
const
std::string & package_name)
39
{
40
#if __has_include("ament_index_cpp/get_package_share_path.hpp")
41
return
ament_index_cpp::get_package_share_path(package_name);
42
#else
43
return
ament_index_cpp::get_package_share_directory(package_name);
44
#endif
45
}
46
47
}
// namespace easynav
48
49
#endif
// EASYNAV_COMMON__PACKAGESHARE_HPP_
easynav
Definition
CircularBuffer.hpp:24
easynav::get_package_share_path
std::filesystem::path get_package_share_path(const std::string &package_name)
Returns the share directory of package_name.
Definition
PackageShare.hpp:38
Generated by
1.18.0