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

onInit() hangs on getParam and doesn't return in my nodelet

asked 2015-10-16 20:38:35 -0500

ygzhangsoya gravatar image

Used gdb to step into my onInit() function. Everything was fine till reaching getParam, after which the process hangs there.

void MyNodelet::onInit()
    bool rv = true ;

    ros::NodeHandle n(getNodeHandle()) ;
    ros::NodeHandle pn(getPrivateNodeHandle()) ;

    pn.getParam("Left Image Id", leftImgId_str_) ;
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-10-17 07:41:54 -0500

Dimitri Schachmann gravatar image

updated 2015-10-17 07:42:12 -0500

do you have spaces in your parameter name, or is a quirk of the markup language here? "test_space" Actually I really don't know if spaces are allowed in any way, but to remove them would be the first thing I'd try.

edit flag offensive delete link more


Yes, "space" is the cause of the hanging. Thank you! (I spent two days debugging it and couldn't find it. Thanks to your comment so that my weekend is not completely ruined)

ygzhangsoya gravatar image ygzhangsoya  ( 2015-10-17 14:12:08 -0500 )edit

Spaces are not allows in (graph) names. This is actually explicitly documented on the wiki/Names page.

gvdhoorn gravatar image gvdhoorn  ( 2015-10-18 05:22:13 -0500 )edit

@ygzhangsoya: please accept the answer by @Dimitri Schachmann by clicking on the checkmark left to this answer.

gvdhoorn gravatar image gvdhoorn  ( 2015-10-18 05:22:48 -0500 )edit

Question Tools

1 follower


Asked: 2015-10-16 20:32:49 -0500

Seen: 196 times

Last updated: Oct 16 '15