0
$\begingroup$

Rosanswers logo

I restarted my robot, running ROS Kinetic on a Raspberry Pi, and I'm finding that the master node is immediately crashing on startup with the error:

auto-starting new master
process[master]: started with pid [7708]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to 5dab8662-0754-11e8-a585-b827eb09ee17
process[rosout-1]: started with pid [7721]
started core service [/rosout]
load_parameters: unable to set parameters (last param was [/head_arduino/serial_node/baud=115200]): cannot marshal None unless allow_none is enabled
Traceback (most recent call last):
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/__init__.py", line 307, in main
    p.start()
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/parent.py", line 279, in start
    self.runner.launch()
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/launch.py", line 654, in launch
    self._setup()
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/launch.py", line 641, in _setup
    self._load_parameters()
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/launch.py", line 338, in _load_parameters
    r  = param_server_multi()
  File "/usr/lib/python2.7/xmlrpclib.py", line 1006, in __call__ 
    return MultiCallIterator(self.__server.system.multicall(marshalled_list))
  File "/usr/lib/python2.7/xmlrpclib.py", line 1243, in __call__ 
    return self.__send(self.__name, args)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1596, in __request
    allow_none=self.__allow_none)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1094, in dumps
    data = m.dumps(params)
  File "/usr/lib/python2.7/xmlrpclib.py", line 638, in dumps
    dump(v, write)
  File "/usr/lib/python2.7/xmlrpclib.py", line 660, in __dump
    f(self, value, write)
  File "/usr/lib/python2.7/xmlrpclib.py", line 719, in dump_array
    dump(v, write)
  File "/usr/lib/python2.7/xmlrpclib.py", line 660, in __dump
    f(self, value, write)
  File "/usr/lib/python2.7/xmlrpclib.py", line 741, in dump_struct
    dump(v, write)
  File "/usr/lib/python2.7/xmlrpclib.py", line 660, in __dump
    f(self, value, write)
  File "/usr/lib/python2.7/xmlrpclib.py", line 719, in dump_array
    dump(v, write)
  File "/usr/lib/python2.7/xmlrpclib.py", line 660, in __dump
    f(self, value, write)
  File "/usr/lib/python2.7/xmlrpclib.py", line 664, in dump_nil  
    raise TypeError, "cannot marshal None unless allow_none is enabled"
TypeError: cannot marshal None unless allow_none is enabled
[rosout-1] killing on exit
[master] killing on exit

Looking in my ~/.ros/latest/latest/roslaunch-rae-8050.log I also see the lines:

[roslaunch][INFO] '2018-02-01 08:55:26': load_parameters starting ...
[roslaunch][ERROR] '2018-02-01 08:55:26': load_parameters: unable to set parameters (last param was [/head_arduino/serial_node/baud=115200]): cannot marshal None unless allow_none is enabled

What's causing this?

My node /head_arduino/serial_node/baud=115200 is just a stock rosserial serial_node.py instance launched with:

<launch>
    <group ns="head_arduino">
        <node pkg="rosserial_python" type="serial_node.py" name="serial_node" output="screen">
            <param name="~port" value="/dev/ttyACM0" />
            <param name="~baud" value="115200" />
        </node>
    </group>
</launch>

Clearly, none of its parameters are None.

Googling the error suggests it's a generic exception thrown by xmlrpclib when an XMLRPC endpoint receives a bad value, but obviously, that could mean anything here. Is this evidence that the Pi wasn't cleanly shutdown and that data was corrupted somewhere, causing bad data to be loaded via the ros parameter server?

How would I fix or purge this bad data? How do I reset the parameter server so it loads the correct parameters from my launch files?

Edit: I was running everything from a single all.launch file that looks like:

<launch>
    <include file="$(find myrobot)/launch/serial_head.launch" />
    <include file="$(find myrobot)/launch/serial_torso.launch" />
    <include file="$(find myrobot)/launch/raspicam_compressed_320.launch" />
    <include file="$(find myrobot)/launch/sound.launch" />
    <include file="$(find myrobot)/launch/diagnostics_aggregator.launch" />
    <include file="$(find myrobot)/launch/robot_state_publisher.launch" />
    ...
</launch>

To simply things, I tried running just roscore and then the launch file for my serial_node.py, and that ran fine. But when I again ran my all.launch the error re-occurred. Why is this? Does the ROS parameter server cache parameters per parent launch file?

I tried this suggestion to add clear_params="true" to all my nodes, but that had no effect.

I noticed that the <include> tag allows supports clear_param, so I tried that, but that just gives me a different error. It apparently requires the tag's ns parameter be set, so I changed my include tags to end with clear_param="true" ns="/" />, but that just made it immediately fail with the error:

Failed to clear parameter: parameter [/] is not set

Originally posted by Cerin on ROS Answers with karma: 940 on 2018-02-01

Post score: 1

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

As you've found, roslaunch is crashing because some parameter isn't specified correctly.

The roscore itself is fine; this error happens when roslaunch tries to set a parameter. the order of operations is roughly:

  • roslaunch starts
  • roslaunch sees that a roscore is not running, so it starts one
  • roslaunch tries to set parameters. One of them is bad, so roslaunch decides to shut down
  • since roslaunch started the roscore, when it is shutting down it stops the roscore.
  • Note that roslaunch says killing on exit for the roscore and rosout processes.

roslaunch is printing the last parameter that was loaded successfully. Since that's the last parameter in your serial_head.launch, and the next file included is serial_torso.launch, it would make sense to look in serial_torso.launch for your error.


Originally posted by ahendrix with karma: 47576 on 2018-02-02

This answer was NOT ACCEPTED on the original site

Post score: 1


Original comments

Comment by Cerin on 2018-02-02:
My parameters in the launch files appear to be fine. The parameters in my serial_torso are all identical to serial_head.

Comment by Cerin on 2018-02-02:
This has been running perfectly for months, and I haven't changed any code. The only thing that changed was I had power loss on my Pi, after which this problem suddenly started happening, suggesting the problem is data corruption.

Comment by Cerin on 2018-02-02:
The problem is that the launch files aren't executed sequentially, so simply looking at the "last launch file" doesn't help. Every run, I'm getting a different "last successfully loaded parameter". This is very frustrating that it won't tell me the source of the underlying error.

$\endgroup$
0
$\begingroup$

Rosanswers logo

Since the error message doesn't specify the launch file causing the error, I was forced to go through my top-level launch file, comment everything out, and then one by one, re-enable each child launch file, and then re-run it, testing to see if I received the error.

This allowed me to track the error down to my launch file for the diagnostics_aggregator. Again, the launch file itself doesn't pass in any blank or None values. However, I was loading a configuration file with:

<rosparam command="load" file="$(find myrobot)/config/analyzers.yaml" />

I checked this file, and sure enough, it was corrupt. I re-uploaded this file, and that resolved the issue.


Originally posted by Cerin with karma: 940 on 2018-02-02

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.