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

node doesn't work after running rosrun

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

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
0

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

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

Comments

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 -0600 )edit
0

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

bobpop gravatar image

updated 2017-05-01 23:01:01 -0600

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

Comments

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 -0600 )edit

Question Tools

1 follower

Stats

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

Seen: 714 times

Last updated: May 02 '17