diff --git a/src/node/choreonoid_ros2.cpp b/src/node/choreonoid_ros2.cpp index 65e40ec..bed4a2c 100644 --- a/src/node/choreonoid_ros2.cpp +++ b/src/node/choreonoid_ros2.cpp @@ -1,16 +1,11 @@ -#include +#include #include #include -#include -#include #include -#include -#include #include #include -#include int main(int argc, char** argv) { @@ -31,14 +26,8 @@ int main(int argc, char** argv) cnoid::App app(nonRosArgc, nonRosArgv, "Choreonoid-ROS2", "Choreonoid"); - auto plugin_manager = cnoid::PluginManager::instance(); - - if(auto pluginPath = getenv("CNOID_PLUGIN_PATH")){ - plugin_manager->addPluginPath(cnoid::toUTF8(pluginPath)); - } - - auto plugin_path = ament_index_cpp::get_package_share_directory("choreonoid_ros") + "/../../lib/choreonoid_ros"; - plugin_manager->addPluginPath(plugin_path); + cnoid::PluginManager::instance()->addPluginDirectoryAsPrefix( + ament_index_cpp::get_package_prefix("choreonoid_ros")); app.requirePluginToCustomizeApplication("ROS2");