Skip to content

Commit

Permalink
Fix the initialization of the additional plugin path in the choreonoi…
Browse files Browse the repository at this point in the history
…d node for ROS 2
  • Loading branch information
s-nakaoka committed Mar 21, 2024
1 parent c2d039f commit 422489e
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions src/node/choreonoid_ros2.cpp
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
#include <ament_index_cpp/get_package_share_directory.hpp>
#include <ament_index_cpp/get_package_prefix.hpp>
#include <rclcpp/utilities.hpp>

#include <cnoid/App>
#include <cnoid/ExecutablePath>
#include <cnoid/Plugin>
#include <cnoid/PluginManager>
#include <cnoid/ProjectManager>
#include <cnoid/UTF8>

#include <string>
#include <vector>
#include <cstdlib>

int main(int argc, char** argv)
{
Expand All @@ -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");

Expand Down

0 comments on commit 422489e

Please sign in to comment.