pub no data after running rosrun

asked 2017-04-28 01:27:43 -0500

DaDaLee gravatar image

updated 2017-05-01 21:55:16 -0500

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;"< 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



I assume that you did not load the parameters that are loaded in the launch file. With no parameters I assume that the node is not initialized correctly or waits for the parameters to be loaded. With rosrun, I suggest loading the params beforehand, use the correct namespace when loading

angeltop gravatar image angeltop  ( 2017-04-28 02:00:04 -0500 )edit

Ok.That sounds rather reasonable. Well,but how to load the params beforehand?

DaDaLee gravatar image DaDaLee  ( 2017-04-28 02:44:06 -0500 )edit use rosparam load and then do rosrun

angeltop gravatar image angeltop  ( 2017-04-28 03:25:48 -0500 )edit

It's not working.I run rosparam load ekf_template.yaml first,then do rosrun robot_localization ekf_localization_node.Actually it leads to nothing.I try to run rostopic echo /odomfiltered but fail to fetch the desired data output.I assume that the node isn't operating at all.Thank you so much Angel

DaDaLee gravatar image DaDaLee  ( 2017-04-28 03:46:40 -0500 )edit

you have to specify the namespace as well. In the launch file the params are loaded in the node which means that they are in the node namespace.Run the node, do rosnode list to get its name, kill the node, load the parameters on this namespace and run the node again.Or just use the launch file

angeltop gravatar image angeltop  ( 2017-04-28 03:51:49 -0500 )edit

The node name is /ekf_navigation_node.Maybe your proposal leads me to run command like this:rosparam load /ekf_navigation_node ekf_template.yaml,then a error occured:file [/ekf_navigation_node] does not exist. Would you mind enlighten to me the entire operation?I'm extremely grateful for your help

DaDaLee gravatar image DaDaLee  ( 2017-04-28 04:23:29 -0500 )edit

rosparam load <yaml-file> [namespace] according to the wiki page</yaml-file>

angeltop gravatar image angeltop  ( 2017-04-28 04:26:10 -0500 )edit

Oh..I'm sorry I should have noticed that while going through the wiki page beforeAnd again I ran as it tells me,it's not working.Maybe something else went wrong?

DaDaLee gravatar image DaDaLee  ( 2017-04-28 04:35:10 -0500 )edit