# Revision history [back]

I haven't checked this in any was, but while reading wiki/joy: Nodes - Published and comparing it with the code you show, I noticed this:

Advertise("/joy_node", "sensor_msgs/Joy");


The topic to publish sensor_msgs/Joy messages on is called joy. The node that typically does this would be called joy_node.

Your code appears to be publishing to a topic called joy_node, which, if your downstream consumers expect the regular topic, will result in no messages being received. This could explain why you get the error your report (but it might also not).

You may want to run roswtf after you have started up your application (including all ROS nodes). I suspect it will report some unconnected subscribers and/or publishers.

I haven't checked this in any was, but while reading wiki/joy: Nodes - PublishedNodes and comparing it with the code you show, I noticed this:

Advertise("/joy_node", "sensor_msgs/Joy");


The topic to publish sensor_msgs/Joy messages on is called joy. The node that typically does this would be called joy_node.

Your code appears to be publishing to a topic called joy_node, which, if your downstream consumers expect the regular topic, will result in no messages being received. This could explain why you get the error your report (but it might also not).

You may want to run roswtf after you have started up your application (including all ROS nodes). I suspect it will report some unconnected subscribers and/or publishers.

I haven't checked this in any was, but while reading wiki/joy: Nodes and comparing it with the code you show, I noticed this:

Advertise("/joy_node", "sensor_msgs/Joy");


The topic to publish sensor_msgs/Joy messages on is called joy. The node that typically does this would be called joy_node.

Your code appears to be publishing to a topic called joy_node, which, if your downstream consumers expect the regular topic, will result in no messages being received. received by those subscribers. This could explain why you get the error your report (but it might also not).

You may want to run roswtf after you have started up your application (including all ROS nodes). I suspect it will report some unconnected subscribers and/or publishers.

I haven't checked this in any was, way, but while reading wiki/joy: Nodes and comparing it with the code you show, I noticed this:

Advertise("/joy_node", "sensor_msgs/Joy");


The topic to publish sensor_msgs/Joy messages on is called joy. The node that typically does this would be called joy_node.

Your code appears to be publishing to a topic called joy_node, which, if your downstream consumers expect the regular topic, will result in no messages being received by those subscribers. This could explain why you get the error your report (but it might also not).

You may want to run roswtf after you have started up your application (including all ROS nodes). I suspect it will report some unconnected subscribers and/or publishers.

Edit:

I just noticed this part in your String joynode:

[..] \"frame_id\": " + frame_id + "}, [..]


frame_id is a string, so it must be quoted, even in JSON.

I would expect something like this:

[..] \"frame_id\": \"" + frame_id + "\"}, [..]


note the additional \" surrounding the frame_id.

Unless whatever library you're using for emitting JSON takes care of this itself, I suspect that is actually the problem.

Your comment about "an empty frame_id string" working seems to point to the same cause, as you don't pass an empty frame_id variable, but an explicit \"\".

Original answer: I haven't checked this in any way, but while reading wiki/joy: Nodes and comparing it with the code you show, I noticed this:

Advertise("/joy_node", "sensor_msgs/Joy");


The topic to publish sensor_msgs/Joy messages on is called joy. The node that typically does this would be called joy_node.

Your code appears to be publishing to a topic called joy_node, which, if your downstream consumers expect the regular topic, will result in no messages being received by those subscribers. This could explain why you get the error your report (but it might also not).

You may want to run roswtf after you have started up your application (including all ROS nodes). I suspect it will report some unconnected subscribers and/or publishers.

Edit:

I just noticed this part in your String joynode:

[..] \"frame_id\": " + frame_id + "}, [..]


frame_id is a string, so it must be quoted, even in JSON.

I would expect something like this:

[..] \"frame_id\": \"" + frame_id + "\"}, [..]


note the additional \" surrounding the frame_id.

Unless whatever library you're using for emitting JSON takes care of this itself, I suspect that is actually the problem.problem (if you're not using any library for serialising Java objects to JSON, you may consider using one, as it could prevent issues with quoting and general JSON layout).

Your comment about "an empty frame_id string" working seems to point to the same cause, as you don't pass an empty frame_id variable, but an explicit \"\".

Original answer: I haven't checked this in any way, but while reading wiki/joy: Nodes and comparing it with the code you show, I noticed this:

Advertise("/joy_node", "sensor_msgs/Joy");


The topic to publish sensor_msgs/Joy messages on is called joy. The node that typically does this would be called joy_node.

Your code appears to be publishing to a topic called joy_node, which, if your downstream consumers expect the regular topic, will result in no messages being received by those subscribers. This could explain why you get the error your report (but it might also not).

You may want to run roswtf after you have started up your application (including all ROS nodes). I suspect it will report some unconnected subscribers and/or publishers.

Edit:

I just noticed this part in your String joynode:

[..] \"frame_id\": " + frame_id + "}, [..]


frame_id is a string, so it must be quoted, even in JSON.

I would expect something like this:

[..] \"frame_id\": \"" + frame_id + "\"}, [..]


note the additional \" surrounding the frame_id.

Unless whatever library you're using for emitting JSON takes care of this itself, I suspect that is actually the problem (if you're not using any library for serialising Java objects to JSON, you may could consider using one, as it could prevent issues with quoting and general JSON layout).

Your comment about "an empty frame_id string" working seems to point to the same cause, as you don't pass an empty frame_id variable, but an explicit \"\".

Original answer: I haven't checked this in any way, but while reading wiki/joy: Nodes and comparing it with the code you show, I noticed this:

Advertise("/joy_node", "sensor_msgs/Joy");


The topic to publish sensor_msgs/Joy messages on is called joy. The node that typically does this would be called joy_node.

Your code appears to be publishing to a topic called joy_node, which, if your downstream consumers expect the regular topic, will result in no messages being received by those subscribers. This could explain why you get the error your report (but it might also not).

You may want to run roswtf after you have started up your application (including all ROS nodes). I suspect it will report some unconnected subscribers and/or publishers.