Ask Your Question
0

How can I use rosnode to see nodes within other nodes?

asked 2016-06-15 04:20:09 -0500

sonitron gravatar image

Hello,

I am trying to run several nodes within the same executable. Here is a minimal example (a shortened version of this tutorial):

#include "ros/ros.h"
#include "std_msgs/String.h"
int main(int argc, char **argv)
{
    ros::init(argc, argv, "node_handle_namespaces");
    ros::NodeHandle node1("level1");
    while(ros::ok()) {}
    return 0;
}

When I run this example, the output of rosnode list is:

/node_handle_namespaces
/rosout

How can I see whether the level1 node is running?

edit retag flag offensive close merge delete

Comments

maybe consider nodelets?

Mehdi. gravatar image Mehdi.  ( 2016-06-15 04:47:40 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-06-15 04:24:47 -0500

gvdhoorn gravatar image

In ROS1, there is a one-to-one mapping between nodes and processes. Multiple NodeHandles can be created, but they don't map to separate nodes.

Can you perhaps explain a bit more what you are trying to do?

edit flag offensive delete link more

Comments

I want to create a hierarchical multi-agent system with multiple robots that each have several actors. Each robot should have a node handle that I can send commands to. Each actor of the robot should have a node handle that the robot controller can send commands to.

sonitron gravatar image sonitron  ( 2016-06-15 04:39:33 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-06-15 04:19:18 -0500

Seen: 77 times

Last updated: Jun 15 '16