ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

node doesn't work after running rosrun

asked 2017-05-01 21:57:15 -0500

DaDaLee gravatar image

I'm using a package named robot_localizaton offered by ROS downloaded from github.Here's the problem: I put a couple lines of code to export position data,it goes like this:

"cout<<"robot's y position: "<<filteredposition.pose.pose.position.y&lt;<endl;"&lt; p="">

but I didn't get desired output in the terminal after rosrun robot_localization ekf_localization_node(already get params loaded).I assume the node doesn't operate at all. What confuses me most is that running rostopic echo /odomfiltered leads to data stream output. Any answer would be appreciated,thank you so much.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2017-05-02 01:41:28 -0500

AlexisTM gravatar image

First : verify that the navigation node give you an output. If the node is not initialized or is missing data input, you will have no output.

Then you should use ROS logging system, it is much better to use as it is synchronized so you don't have thread printing issues and it serialize your ROS objects.

ROS_INFO_STREAM("hey :" << filteredposition);

edit flag offensive delete link more


That's impressive.Would you share me a link of ROS_INFO_STREAM?I want to delve int the usage of it.THX a lot

DaDaLee gravatar image DaDaLee  ( 2017-05-02 02:30:09 -0500 )edit

answered 2017-05-01 22:54:19 -0500

bobpop gravatar image

updated 2017-05-01 23:01:01 -0500

Firstly, rostopic echo can get the data,it means that your publisher is right.Perhaps you should check the subscriber with rostopic info after running all nodes.If it subcribes the topic correctly,Problems should occurred in the callback function.Good luck!

edit flag offensive delete link more


Thank you for your reasonable proposal.But I'm using a package named robot_localization offered by ROS,I assume there shouldn't be any problem with callback function.It's confusing.Thanks anyway.

DaDaLee gravatar image DaDaLee  ( 2017-05-02 01:15:02 -0500 )edit

Question Tools

1 follower


Asked: 2017-05-01 21:57:15 -0500

Seen: 686 times

Last updated: May 02 '17