Skip to content

Commit

Permalink
Delete init/shutdown process of ROS 2 from app
Browse files Browse the repository at this point in the history
  • Loading branch information
HansRobo committed Mar 2, 2024
1 parent 9a281d1 commit 5e3a00c
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions src/node/choreonoid_ros2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,6 @@ namespace filesystem = stdx::filesystem;

int main(int argc, char** argv)
{
regex remapPattern("^.+:=.+$");
vector<char*> args{argv[0]};
vector<char*> rosargs{argv[0]};
for (int i = 1; i < argc; ++i) {
if (regex_match(argv[i], remapPattern)) {
rosargs.push_back(argv[i]);
} else {
args.push_back(argv[i]);
}
}

int rosargc = rosargs.size();
char** rosargv = &rosargs.front();
rclcpp::init(rosargc, rosargv);

argc = args.size();
argv = &args.front();
cnoid::App app(argc, argv, "Choreonoid-ROS2", "Choreonoid");

auto plugin_manager = cnoid::PluginManager::instance();
Expand All @@ -50,7 +33,5 @@ int main(int argc, char** argv)

int ret = app.exec();

rclcpp::shutdown();

return ret;
}

0 comments on commit 5e3a00c

Please sign in to comment.