Skip to content

Commit

Permalink
feat: use object_centers.csv in share directory (#47)
Browse files Browse the repository at this point in the history
* feat: install lidar_sim/config to share dir

* feat: load object csv from share dir (autoware_practice_lidar_simulator)

* fix: add include ament_index_cpp

* fix: use INSTALL_TO_SHARE in lidar_simulator pkg

* style: pre-commit

Signed-off-by: Takagi, Isamu <[email protected]>

---------

Signed-off-by: Takagi, Isamu <[email protected]>
Co-authored-by: Takagi, Isamu <[email protected]>
  • Loading branch information
KentaKato and isamu-takagi authored Jun 27, 2024
1 parent 98b23a4 commit 12acc1c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/autoware_practice_lidar_simulator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ if(BUILD_TESTING)
ament_lint_auto_find_test_dependencies()
endif()

ament_auto_package(INSTALL_TO_SHARE launch)
ament_auto_package(INSTALL_TO_SHARE config launch)
1 change: 1 addition & 0 deletions src/autoware_practice_lidar_simulator/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

<buildtool_depend>ament_cmake_auto</buildtool_depend>

<depend>ament_index_cpp</depend>
<depend>autoware_auto_control_msgs</depend>
<depend>autoware_auto_planning_msgs</depend>
<depend>autoware_auto_vehicle_msgs</depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

#include "simple_lidar_simulator.hpp"

#include <ament_index_cpp/get_package_share_directory.hpp>

#include <pcl_conversions/pcl_conversions.h>

#include <fstream>
Expand All @@ -35,7 +37,8 @@ SampleNode::SampleNode() : Node("simple_lidar_simulator")
timer_ = rclcpp::create_timer(this, get_clock(), period, [this] { on_timer(); });

// 物体の中心位置リストをCSVから読み取って初期化
object_centers_ = load_object_centers_from_csv("src/autoware_practice_lidar_simulator/config/object_centers.csv");
const auto pkg_path = ament_index_cpp::get_package_share_directory("autoware_practice_lidar_simulator");
object_centers_ = load_object_centers_from_csv(pkg_path + "/config/object_centers.csv");
}

void SampleNode::pose_callback(const PoseStamped::SharedPtr msg)
Expand Down

0 comments on commit 12acc1c

Please sign in to comment.