Ask Your Question
0

Error during mavros Multi-Vehicle Simulation with px4 in Gazebo

asked 2018-02-05 00:14:42 -0600

Nebula gravatar image

I followed the instruction as mentioned here. Everything worked fine but at last stage when I try to run:-

roslaunch px4 multi_uav_mavros_sitl.launch

I get following:-

... logging to /home/yograj/.ros/log/e3420ce0-0a3a-11e8-a1f1-3c77e68de09b/roslaunch-yograj-Inspiron-5537-11096.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

Traceback (most recent call last):
  File "/opt/ros/kinetic/share/xacro/xacro.py", line 55, in <module>
    import xacro
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/xacro/__init__.py", line 42, in <module>
    from roslaunch import substitution_args
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/__init__.py", line 56, in <module>
    from .launch import ROSLaunchRunner
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/launch.py", line 55, in <module>
    from roslaunch.nodeprocess import create_master_process, create_node_process
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/roslaunch/nodeprocess.py", line 52, in <module>
    from rosmaster.master_api import NUM_WORKERS
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/__init__.py", line 35, in <module>
    from .main import rosmaster_main
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/main.py", line 43, in <module>
    import rosmaster.master
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/master.py", line 47, in <module>
    import rosmaster.master_api
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/master_api.py", line 72, in <module>
    from rosmaster.util import xmlrpcapi
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosmaster/util.py", line 48, in <module>
    from defusedxml.xmlrpc import monkey_patch
ImportError: No module named defusedxml.xmlrpc
while processing /home/yograj/src/Firmware/launch/single_vehcile_spawn.launch:
Invalid <param> tag: Cannot load command parameter [iris_1_sdf]: command [/opt/ros/kinetic/share/xacro/xacro.py /home/yograj/src/Firmware/Tools/sitl_gazebo/models/rotors_description/urdf/iris_base.xacro rotors_description_dir:=/home/yograj/src/Firmware/Tools/sitl_gazebo/models/rotors_description mavlink_udp_port:=14560 > iris_1.urdf ; 'gz sdf -p iris_1.urdf'] returned with code [1]. 

Param xml is <param command="$(arg cmd)" name="$(arg vehicle)_$(arg ID)_sdf"/>
The traceback for the exception was written to the log file
edit retag flag offensive close merge delete

Comments

I solved import error by pip install but I am still getting invalid param error.

Nebula gravatar image Nebula  ( 2018-02-05 00:23:47 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-02-26 08:39:26 -0600

Nebula gravatar image

If someone using old version of px4 firmware. There was some problem with launch file (single_vehcile_spawn.launch file). Correcting (line 18)

 <arg name="cmd" default="$(find xacro)/xacro.py $(find px4)/Tools/sitl_gazebo/models/rotors_description/urdf/$(arg vehicle)_base.xacro rotors_description_dir:=$(find px4)/Tools/sitl_gazebo/models/rotors_description mavlink_udp_port:=$(arg mavlink_udp_port) > $(arg vehicle)_$(arg ID).urdf ; 'gz sdf -p $(arg vehicle)_$(arg ID).urdf'" />

in single_vehcile_spawn.launch with

<arg name="cmd" default="$(find xacro)/xacro.py $(find px4)/Tools/sitl_gazebo/models/rotors_description/urdf/$(arg vehicle)_base.xacro rotors_description_dir:=$(find px4)/Tools/sitl_gazebo/models/rotors_description mavlink_udp_port:=$(arg mavlink_udp_port)" />
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-02-05 00:14:42 -0600

Seen: 503 times

Last updated: Feb 26 '18