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

How to solve the error "cannot marshal None unless allow_none is enabled ”

asked 2014-05-16 04:30:08 -0600

scopus gravatar image

updated 2020-12-07 16:39:58 -0600

lucasw gravatar image

In my launch file server_gateway.launch, it launch another file whose contents is as follows.

     <launch> 
        <!-- ******************************* Arguments ******************************* --> 
        <arg name="concert_name" default="multinav_concert_scopus"/>
        <arg name="concert_hub_uri" default="http://localhost:6380"/>
        <arg name="gateway_watch_loop_period" default="2"/>
        <arg name="disable_uuids" default="false"/> 

        <!-- ********************************* Hub *********************************** --> 
         <include file="$(find rocon_hub)/launch/hub.launch">  
         <arg name="hub_name" value="$(arg concert_name)" />
         <arg name="hub_port" value="6380" />  </include>  

        <!-- ******************************* Zeroconf ******************************** -->
        <node ns="zeroconf" pkg="zeroconf_avahi" type="zeroconf" name="zeroconf"/> 

        <!-- ******************************** Gateway ******************************** -->  
        <node pkg="rocon_gateway" type="gateway.py" name="gateway">    
          <rosparam command="load" file="$(find rocon_gateway)/param/default.yaml"/>  
          <rosparam command="load" file="$(find rocon_gateway)/param/default_blacklist.yaml"/>   
          <rosparam command="load" file="$(find scopus_gateway)/param/server_advertisements.yaml" />   
          <rosparam command="load" file="$(find scopus_gateway)/param/server_flips.yaml" /> 
          <param name="hub_uri" value="$(arg concert_hub_uri)"/>    
          <param name="name" value="$(arg concert_name)"/>  
          <param name="firewall" value="false"/>
          <param name="watch_loop_period" value="$(arg gateway_watch_loop_period)"/> 
          <param name="hub_whitelist" value=""/>  
          <param name="disable_uuids" value="$(arg disable_uuids)"/>  
        </node> 
</launch>

But when running roslaunch server_gateway.launch, it comes out error:

load_parameters: unable to set parameters (last param was [/concert/gateway/hub_uri=http://localhost:6380]): cannot marshal None unless allow_none is enabled

Traceback (most recent call last):  File "/opt/ros/hydro/lib/python2.7/dist-packages/roslaunch/__init__.py", line 279, in main    p.start()  

File "/opt/ros/hydro/lib/python2.7/dist-packages/roslaunch/parent.py", line 268, in start    self.runner.launch()

File "/opt/ros/hydro/lib/python2.7/dist-packages/roslaunch/launch.py", line 644, in launch    self._setup()  

File "/opt/ros/hydro/lib/python2.7/dist-packages/roslaunch/launch.py", line 631, in _setup    self._load_parameters() 

File "/opt/ros/hydro/lib/python2.7/dist-packages/roslaunch/launch.py", line 328, in _load_parameters    r  = param_server_multi() 

File "/usr/lib/python2.7/xmlrpclib.py", line 997, in __call__    return MultiCallIterator(self.__server.system.multicall(marshalled_list))  

File "/usr/lib/python2.7/xmlrpclib.py", line 1224, in __call__    return self.__send(self.__name, args)  

File "/usr/lib/python2.7/xmlrpclib.py", line 1572, in __request    allow_none=self.__allow_none)  

File "/usr/lib/python2.7/xmlrpclib.py", line 1085, in dumps    data = m.dumps(params)  

File "/usr/lib/python2.7/xmlrpclib.py", line 632, in dumps    dump(v, write)  

File "/usr/lib/python2.7/xmlrpclib.py", line 654, in __dump    f(self, value, write)  

File "/usr/lib/python2.7/xmlrpclib.py", line 714, in dump_array    dump(v, write)  

File "/usr/lib/python2.7/xmlrpclib.py", line 654, in __dump    f(self, value, write)  

File "/usr/lib/python2.7/xmlrpclib.py", line 735, in dump_struct    dump(v, write)  

File "/usr/lib/python2.7/xmlrpclib.py", line 654, in __dump    f(self, value, write)  

File "/usr/lib/python2.7/xmlrpclib.py", line 714, in dump_array    dump(v, write)  

File "/usr/lib/python2.7/xmlrpclib.py", line 654, in __dump    f(self, value, write)  

File "/usr/lib/python2.7/xmlrpclib.py", line 658, in dump_nil    raise TypeError, "cannot marshal None unless 
allow_none is ...
(more)
edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
6

answered 2014-05-16 06:27:12 -0600

ahendrix gravatar image

In general, this occurs because you tried to set a parameter to None, which isn't allowed.

In your particular case, It looks like you're trying to set the hub_whitelist parameter to an empty string, which is probably getting transformed into a None somewhere in roslaunch.

In general, you should be able to troubleshoot this by commenting out lines in your launch file until you find the one that is causing the error.

edit flag offensive delete link more

Comments

Thank you very much! This problem has been solved by your advice

scopus gravatar image scopus  ( 2014-05-18 16:34:14 -0600 )edit
2

answered 2019-08-05 06:49:47 -0600

You can also check the indentation of the parameters in the yaml files that are included in the launch file for this problem as this method worked for me.

edit flag offensive delete link more

Comments

The problem can also be caused by rosparam load if there is a key in your yaml which does not have a value.

heuristicus gravatar image heuristicus  ( 2020-02-14 10:27:33 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2014-05-16 04:30:08 -0600

Seen: 21,360 times

Last updated: Dec 07 '20