Skip to content

Commit

Permalink
Reorder ros node initialization to allow renaming of bridge
Browse files Browse the repository at this point in the history
Signed-off-by: Harsh Deshpande <harshavardhan.deshpande@ipa.fraunhofer.de>
  • Loading branch information
Victor Lopez authored and hsd-dev committed Nov 17, 2020
1 parent 2e63e65 commit 83195f2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/action_bridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,15 @@

int main(int argc, char *argv[])
{
// ROS 1 node
ros::init(argc, argv, "ros_bridge");
ros::NodeHandle ros1_node;

// ROS 2 node
// must be before ROS1, because ros::init consumes args like __name and we cannot remap the node
rclcpp::init(argc, argv);
auto ros2_node = rclcpp::Node::make_shared("ros_bridge");

// ROS 1 node
ros::init(argc, argv, "ros_bridge");
ros::NodeHandle ros1_node;

std::string dir = argv[1];
std::string package = argv[2];
std::string type = argv[3];
Expand Down

0 comments on commit 83195f2

Please sign in to comment.