strange connection problem between two nodes [closed]

asked 2012-09-11 03:27:49 -0500

RichiW gravatar image

updated 2012-09-11 04:36:48 -0500

Lorenz gravatar image

hi,

i wrote a gui-program, but in rxgraph there is no connection established between the 2 nodes: image rxgraph

gui:

  • advertises: p2os_driver/MotorState "cmd_motor_state"
  • ...

p2os_driver

  • subscribes: p2os_driver/MotorState "cmd_motor_state"

if I start rostopic echo /cmd_motor_state -> connection between the gui-node and the rostopic node is established, and the message from the gui-node is printed on the screen without any problem.

if I start p2os_dashboard (also advertises cmd_motor_state) the connection between the p2os_driver or rostopic-node and p2os_dashboard is established - everything works fine. (but written in py)

But the communication between the gui-node and p2os_driver doesn't work...

gui-program:

ros::Publisher cmd_motorState; 
//header

cmd_motorState = n.advertise<p2os_driver::MotorState>("cmd_motor_state", 100);

motorStateValue.state = (int)1;

cmd_motorState.publish(motorStateValue);

p2os_driver (no changes made ​​by me)

cmdmstate_sub_ = n.subscribe("cmd_motor_state", 1, &P2OSNode::cmdmotor_state,this);

void P2OSNode::cmdmotor_state( const p2os_driver::MotorStateConstPtr &msg)

I would appreciate any help

thanks

R.

edit: info about the nodes

Node [/p3aat_gui]
Publications: 
 * /p3aat_gui [std_msgs/String]
 * /cmd_motor_state [p2os_driver/MotorState]
 * /rosout [rosgraph_msgs/Log]

Subscriptions: 
 * /p3aat [std_msgs/String]
 * /front_laser [unknown type]
 * /sonar [p2os_driver/SonarArray]
 * /motor_state [p2os_driver/MotorState]
 * /battery_state [p2os_driver/BatteryState]
 * /Laser_Camera [sensor_msgs/LaserScan]

Services: 
 * /p3aat_gui/get_loggers
 * /p3aat_gui/set_logger_level


contacting node http://localhost:41399/ ...
Pid: 20774
Connections:
 * topic: /cmd_motor_state
    * to: /rostopic_20972_1347372653882
    * direction: outbound
    * transport: TCPROS
 * topic: /p3aat_gui
    * to: /p3aat
    * direction: outbound
    * transport: TCPROS
 * topic: /p3aat
    * to: http://richard-ThinkPad-X200-Tablet:38498/
    * direction: inbound
    * transport: TCPROS
 * topic: /Laser_Camera
    * to: http://ros-mobile:36003/
    * direction: inbound
    * transport: TCPROS
 * topic: /sonar
    * to: http://ros-mobile:59172/
    * direction: inbound
    * transport: TCPROS
 * topic: /battery_state
    * to: http://ros-mobile:59172/
    * direction: inbound
    * transport: TCPROS
 * topic: /motor_state
    * to: http://ros-mobile:59172/
    * direction: inbound
    * transport: TCPROS


Node [/p2os]
Publications: 
 * /sonar [p2os_driver/SonarArray]
 * /aio [p2os_driver/AIO]
 * /tf [tf/tfMessage]
 * /pose [nav_msgs/Odometry]
 * /dio [p2os_driver/DIO]
 * /gripper_state [p2os_driver/GripperState]
 * /battery_state [p2os_driver/BatteryState]
 * /diagnostics [diagnostic_msgs/DiagnosticArray]
 * /rosout [rosgraph_msgs/Log]
 * /ptz_state [p2os_driver/PTZState]
 * /motor_state [p2os_driver/MotorState]

Subscriptions: 
 * /ptz_control [unknown type]
 * /cmd_motor_state [p2os_driver/MotorState]
 * /cmd_vel [geometry_msgs/Twist]
 * /gripper_control [unknown type]

Services: 
 * /p2os/get_loggers
 * /p2os/set_logger_level


contacting node http://ros-mobile:59172/ ...
Pid: 18991
Connections:
 * topic: /rosout
    * to: /rosout
    * direction: outbound
    * transport: TCPROS
 * topic: /battery_state
    * to: /p3aat_gui
    * direction: outbound
    * transport: TCPROS
 * topic: /battery_state
    * to: /p2os_dashboard_21001_1347372702267
    * direction: outbound
    * transport: TCPROS
 * topic: /tf
    * to: /gmapping_node
    * direction: outbound
    * transport: TCPROS
 * topic: /motor_state
    * to: /p3aat_gui
    * direction: outbound
    * transport: TCPROS
 * topic: /motor_state
    * to: /p2os_dashboard_21001_1347372702267
    * direction: outbound
    * transport: TCPROS
 * topic: /sonar
    * to: /p3aat
    * direction: outbound
    * transport: TCPROS
 * topic: /sonar
    * to: /p3aat_gui
    * direction: outbound
    * transport: TCPROS
 * topic: /cmd_vel
    * to: http://richard-ThinkPad-X200-Tablet:38498/
    * direction: inbound
    * transport: TCPROS
 * topic: /cmd_motor_state
    * to: http://richard-ThinkPad-X200-Tablet:46926/
    * direction: inbound
    * transport: TCPROS
edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by tfoote
close date 2015-04-07 00:37:39.427942

Comments

How do you instantiate the node handle? ros::NodeHandle n("~"); or ros::NodeHandle n;

Lorenz gravatar image Lorenz  ( 2012-09-11 03:49:26 -0500 )edit

Also, what's the output of rosnode info &lt;name of your gui node&gt;?

Lorenz gravatar image Lorenz  ( 2012-09-11 04:05:00 -0500 )edit

i instantiate the node with ros::NodeHandle n;

RichiW gravatar image RichiW  ( 2012-09-11 04:07:57 -0500 )edit