pub no data after running rosrun
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<<endl;"
but I didn't get desired output in the terminal after rosrun robotlocalization ekflocalization_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.
Asked by DaDaLee on 2017-04-28 01:27:43 UTC
Comments
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
Asked by angeltop on 2017-04-28 02:00:04 UTC
Ok.That sounds rather reasonable. Well,but how to load the params beforehand?
Asked by DaDaLee on 2017-04-28 02:44:06 UTC
http://wiki.ros.org/rosparam use rosparam load and then do rosrun
Asked by angeltop on 2017-04-28 03:25:48 UTC
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
Asked by DaDaLee on 2017-04-28 03:46:40 UTC
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
Asked by angeltop on 2017-04-28 03:51:49 UTC
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
Asked by DaDaLee on 2017-04-28 04:23:29 UTC
rosparam load [namespace] according to the wiki page http://wiki.ros.org/rosparam
Asked by angeltop on 2017-04-28 04:26:10 UTC
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?
Asked by DaDaLee on 2017-04-28 04:35:10 UTC