PX4 / PX4-SITL_gazebo-classic

Set of plugins, models and worlds to use with OSRF Gazebo Simulator in SITL and HITL.

Home Page:http://dev.px4.io/simulation-gazebo.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to design Custom Drone with velodyne Sensor

kashifzr opened this issue · comments

I work around to design sdf model for Velodyne with Iris drone using iris_rplidar as reference from models, when I run the mavros_posix_sitl.launch file with vehicle := iris_velodyne then output is like

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

setting /run_id to b962af52-55ce-11ee-be1a-37316987660f
process[rosout-1]: started with pid [156844]
started core service [/rosout]
process[sitl-2]: started with pid [156852]

______  __   __    ___ 
| ___ \ \ \ / /   /   |
| |_/ /  \ V /   / /| |
|  __/   /   \  / /_| |
| |     / /^\ \ \___  |
\_|     \/   \/     |_/

px4 starting.

INFO  [px4] startup script: /bin/sh etc/init.d-posix/rcS 0
process[gazebo-3]: started with pid [156863]
ERROR [init] Unknown model gazebo-classic_iris_velodyne (not found by name on /home/rob-kkj/.ros/etc/init.d-posix/airframes)
ERROR [px4] Startup script returned with return value: 256
process[gazebo_gui-4]: started with pid [156872]
process[vehicle_spawn_robkkj_System_Product_Name_156796_3537816507072250960-5]: started with pid [156877]
process[mavros-6]: started with pid [156879]
================================================================================REQUIRED process [sitl-2] has died!
process has died [pid 156852, exit code 255, cmd /home/rob-kkj/home/PX4/Firmware/build/px4_sitl_default/bin/px4 /home/rob-kkj/home/PX4/Firmware/build/px4_sitl_default/etc -s etc/init.d-posix/rcS __name:=sitl __log:=/home/rob-kkj/.ros/log/b962af52-55ce-11ee-be1a-37316987660f/sitl-2.log].
log file: /home/rob-kkj/.ros/log/b962af52-55ce-11ee-be1a-37316987660f/sitl-2*.log
Initiating shutdown!
================================================================================
[ INFO] [1695005686.270737354]: FCU URL: udp://:14540@localhost:14557
[ INFO] [1695005686.272585668]: udp0: Bind address: 0.0.0.0:14540
[ INFO] [1695005686.272675346]: udp0: Remote address: 127.0.0.1:14557
[ INFO] [1695005686.272718579]: GCS bridge disabled
[ INFO] [1695005686.279309973]: Plugin 3dr_radio loaded
[ INFO] [1695005686.280324646]: Plugin 3dr_radio initialized
[ INFO] [1695005686.280390717]: Plugin actuator_control loaded
[ INFO] [1695005686.281897990]: Plugin actuator_control initialized
[ INFO] [1695005686.284810565]: Plugin adsb loaded
[ INFO] [1695005686.286266713]: Plugin adsb initialized
[ INFO] [1695005686.286352061]: Plugin altitude loaded
[ INFO] [1695005686.286794374]: Plugin altitude initialized
[ INFO] [1695005686.286858699]: Plugin cam_imu_sync loaded
[ INFO] [1695005686.287135275]: Plugin cam_imu_sync initialized
[ INFO] [1695005686.287196318]: Plugin camera loaded
[ INFO] [1695005686.287497688]: Plugin camera initialized
[ INFO] [1695005686.287562293]: Plugin cellular_status loaded
[ INFO] [1695005686.288650231]: Plugin cellular_status initialized
[ INFO] [1695005686.288713089]: Plugin command loaded
[ INFO] [1695005686.291499599]: Plugin command initialized
[ INFO] [1695005686.291570140]: Plugin companion_process_status loaded
[ INFO] [1695005686.292757324]: Plugin companion_process_status initialized
[ INFO] [1695005686.292823674]: Plugin debug_value loaded
[ INFO] [1695005686.295359449]: Plugin debug_value initialized
[ INFO] [1695005686.295395697]: Plugin distance_sensor blacklisted
[ INFO] [1695005686.295462746]: Plugin esc_status loaded
[ INFO] [1695005686.296032871]: Plugin esc_status initialized
[ INFO] [1695005686.296103831]: Plugin esc_telemetry loaded
[ INFO] [1695005686.296403386]: Plugin esc_telemetry initialized
[ INFO] [1695005686.296481261]: Plugin fake_gps loaded
[ INFO] [1695005686.304021955]: Plugin fake_gps initialized
[ INFO] [1695005686.304127487]: Plugin ftp loaded
[ INFO] [1695005686.310500064]: Plugin ftp initialized
[ INFO] [1695005686.310609926]: Plugin geofence loaded
[ INFO] [1695005686.312157428]: Plugin geofence initialized
[ INFO] [1695005686.312249900]: Plugin global_position loaded
[ INFO] [1695005686.320160062]: Plugin global_position initialized
[ INFO] [1695005686.320272578]: Plugin gps_input loaded
[ INFO] [1695005686.321654832]: Plugin gps_input initialized
[ INFO] [1695005686.321744999]: Plugin gps_rtk loaded
[ INFO] [1695005686.323199262]: Plugin gps_rtk initialized
[ INFO] [1695005686.323280768]: Plugin gps_status loaded
[ INFO] [1695005686.324465438]: Plugin gps_status initialized
[ INFO] [1695005686.324541985]: Plugin guided_target loaded
[ INFO] [1695005686.326626367]: Plugin guided_target initialized
[ INFO] [1695005686.326709759]: Plugin hil loaded
[ INFO] [1695005686.333091346]: Plugin hil initialized
[ INFO] [1695005686.333192129]: Plugin home_position loaded
[ INFO] [1695005686.335079345]: Plugin home_position initialized
[ INFO] [1695005686.335168534]: Plugin imu loaded
[ INFO] [1695005686.338444710]: Plugin imu initialized
[ INFO] [1695005686.338515461]: Plugin landing_target loaded
[ INFO] [1695005686.344188913]: Plugin landing_target initialized
[ INFO] [1695005686.344274610]: Plugin local_position loaded
[ INFO] [1695005686.346892380]: Plugin local_position initialized
[ INFO] [1695005686.346973188]: Plugin log_transfer loaded
[ INFO] [1695005686.348338541]: Plugin log_transfer initialized
[ INFO] [1695005686.348405729]: Plugin mag_calibration_status loaded
[ INFO] [1695005686.348871021]: Plugin mag_calibration_status initialized
[ INFO] [1695005686.348930666]: Plugin manual_control loaded
[ INFO] [1695005686.350110726]: Plugin manual_control initialized
[ INFO] [1695005686.350175121]: Plugin mocap_pose_estimate loaded
[ INFO] [1695005686.351727023]: Plugin mocap_pose_estimate initialized
[ INFO] [1695005686.351796587]: Plugin mount_control loaded
[mavros-6] killing on exit
[ WARN] [1695005686.353929649]: Could not retrive negate_measured_roll parameter value, using default (0)
[ WARN] [1695005686.354050686]: Could not retrive negate_measured_pitch parameter value, using default (0)
[vehicle_spawn_robkkj_System_Product_Name_156796_3537816507072250960-5] killing on exit
[ WARN] [1695005686.354633243]: Could not retrive negate_measured_yaw parameter value, using default (0)
[gazebo_gui-4] killing on exit
Traceback (most recent call last):
  File "/opt/ros/noetic/lib/gazebo_ros/spawn_model", line 20, in <module>
    import rospy
  File "/opt/ros/noetic/lib/python3/dist-packages/rospy/__init__.py", line 49, in <module>
    from .client import spin, myargv, init_node, \
  File "/opt/ros/noetic/lib/python3/dist-packages/rospy/client.py", line 49, in <module>
[gazebo-3] killing on exit
    import rosgraph
  File "/opt/ros/noetic/lib/python3/dist-packages/rosgraph/__init__.py", line 36, in <module>
    from . masterapi import Master, MasterFailure, MasterError, MasterException
  File "/opt/ros/noetic/lib/python3/dist-packages/rosgraph/masterapi.py", line 47, in <module>
    from . network import parse_http_host_and_port
  File "/opt/ros/noetic/lib/python3/dist-packages/rosgraph/network.py", line 66, in <module>
    if platform.system() == 'FreeBSD':
  File "/usr/lib/python3.8/platform.py", line 892, in system
    return uname().system
  File "/usr/lib/python3.8/platform.py", line 858, in uname
    processor = _syscmd_uname('-p', '')
  File "/usr/lib/python3.8/platform.py", line 612, in _syscmd_uname
    import subprocess
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
[sitl-2] killing on exit
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 844, in exec_module
  File "<frozen importlib._bootstrap_external>", line 976, in get_code
  File "<frozen importlib._bootstrap_external>", line 640, in _compile_bytecode
KeyboardInterrupt
[ WARN] [1695005686.355712171]: Could not retrive debounce_s parameter value, using default (4.000000)
[ WARN] [1695005686.355907032]: Could not retrive err_threshold_deg parameter value, using default (10.000000)
[ INFO] [1695005686.355942163]: Plugin mount_control initialized
[ INFO] [1695005686.356024507]: Plugin nav_controller_output loaded
[ INFO] [1695005686.356302202]: Plugin nav_controller_output initialized
[ INFO] [1695005686.356366038]: Plugin obstacle_distance loaded
[ INFO] [1695005686.357447480]: Plugin obstacle_distance initialized
[ INFO] [1695005686.357511945]: Plugin odom loaded
[ INFO] [1695005686.359117347]: Plugin odom initialized
[ INFO] [1695005686.359190192]: Plugin onboard_computer_status loaded
[ INFO] [1695005686.360095562]: Plugin onboard_computer_status initialized
[ INFO] [1695005686.360166242]: Plugin param loaded
[ INFO] [1695005686.361323255]: Plugin param initialized
[ INFO] [1695005686.361381015]: Plugin play_tune loaded
[ INFO] [1695005686.362411682]: Plugin play_tune initialized
[ INFO] [1695005686.362476495]: Plugin px4flow loaded
[ INFO] [1695005686.365267754]: Plugin px4flow initialized
[ INFO] [1695005686.365343254]: Plugin rallypoint loaded
[ INFO] [1695005686.366497962]: Plugin rallypoint initialized
[ INFO] [1695005686.366520311]: Plugin rangefinder blacklisted
[ INFO] [1695005686.366582331]: Plugin rc_io loaded
[rosout-1] killing on exit
[master] killing on exit
shutting down processing monitor...
... shutting down processing monitor complete
done

OS = 20.04 Focal and ROS = Noetic.

in sdf file for velodyne sensor i am using plugin = libgazebo_ros_velodyne_laser.so

unable to find how to add custom models for sensors and drone are being integrated in PX4-Autopilot

ERROR [px4] Startup script returned with return value: 256

@kashifzr You also need a airframe config for the vehicle on the PX4 side that matches the model name. Or in the launchscript you can set different sdf models and airframes independently.

@Jaeyoung-Lim thanks for giving me idea to solve this issue.

I see some hints specific to airframe #855.
on https://docs.px4.io/main/en/dev_airframes/adding_a_new_frame.html give information specific to frame configuration
I do not understand all the details i so i will check the details

How to add air frames in launch script Any Idea ?