rosserial serial client crash on undefined parameter [closed]

asked 2012-06-12 11:35:22 -0500

bgoldfai gravatar image

I am running fuerte on Ubuntu 12.04, have rosserial installed through apt, and my Arduino code compiling using version 1.0. When I attempt to get a parameter that has not been defined the serial client crashes.

My code running on an Arduino:

float param; while(!nh.connected()) {nh.spinOnce();}
if(!nh.getParam("param", &param)) {param = 1.0;}

Traceback I get in the console when the node crashes:

File "/opt/ros/fuerte/stacks/rosserial/rosserial_python/nodes/", line 58, in <module> File "/opt/ros/fuerte/stacks/rosserial/rosserial_python/src/rosserial_python/", line 244, in run self.handleParameterRequest(msg) File "/opt/ros/fuerte/stacks/rosserial/rosserial_python/src/rosserial_python/", line 274, in handleParameterRequest param = rospy.get_param( File "/opt/ros/fuerte/lib/python2.7/dist-packages/rospy/", line 403, in get_param return _param_server[param_name] #MasterProxy does all the magic for us File "/opt/ros/fuerte/lib/python2.7/dist-packages/rospy/", line 117, in __getitem__ raise KeyError(key) KeyError: 'param'

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by tfoote
close date 2015-03-03 01:52:45.033593