Error Starting JMavSim

Hi guys, I’m new to PX4 and am following the PX4 Development guide. I am using macOS Catalina. I have all the simulation prerequisites and am trying to run jMAVSim. I am trying to run “make posix_sitl_default jmavsim” in the terminal. I keep getting the issue (and sorry I don’t know how to format the code differently):

Makefile:493: *** “Make target posix_sitl_default not found. It either does not exist or posix_sitl_default cannot be the first argument. Use ‘/Library/Developer/CommandLineTools/usr/bin/make help|list_config_targets’ to get a list of all possible [configuration] targets.”. Stop.

I also tried running “make posix jmavsim”, which I saw someone say to do on this forum, but this is what I got:

– PX4 version: v1.11.0-rc1-126-gcfbf69f2a7

– PX4 config file: /Users/lucasmaley/Firmware/boards/px4/sitl/default.cmake

– PX4 config: px4_sitl_default

– PX4 platform: posix

– PX4 lockstep: enabled

– cmake build type: RelWithDebInfo

– The CXX compiler identification is AppleClang

– The C compiler identification is AppleClang

– The ASM compiler identification is Clang

– Found assembler: /Library/Developer/CommandLineTools/usr/bin/cc

– Detecting CXX compiler ABI info

– Detecting CXX compiler ABI info - done

– Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped

– Detecting CXX compile features

– Detecting CXX compile features - done

– Detecting C compiler ABI info

– Detecting C compiler ABI info - done

– Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped

– Detecting C compile features

– Detecting C compile features - done

– Building for code coverage

– ccache enabled (export CCACHE_DISABLE=1 to disable)

– Found PythonInterp: /usr/local/bin/python3 (found suitable version “3.8.5”, minimum required is “3”)

– build type is RelWithDebInfo

– PX4 ECL: Very lightweight Estimation & Control Library v1.9.0-rc1-341-g5356077

– Configuring done

– Generating done

– Build files have been written to: /Users/lucasmaley/Firmware/build/px4_sitl_default

[0/734] git submodule src/drivers/gps/devices

[7/734] Generating uORB topic headers

FAILED: uORB/topics/uORBTopics.hpp uORB/topics/actuator_armed.h uORB/topics/actuator_controls.h uORB/topics/actuator_outputs.h uORB/topics/adc_report.h uORB/topics/airspeed.h uORB/topics/airspeed_validated.h uORB/topics/battery_status.h uORB/topics/camera_capture.h uORB/topics/camera_trigger.h uORB/topics/cellular_status.h uORB/topics/collision_constraints.h uORB/topics/collision_report.h uORB/topics/commander_state.h uORB/topics/cpuload.h uORB/topics/debug_array.h uORB/topics/debug_key_value.h uORB/topics/debug_value.h uORB/topics/debug_vect.h uORB/topics/differential_pressure.h uORB/topics/distance_sensor.h uORB/topics/ekf2_timestamps.h uORB/topics/ekf_gps_drift.h uORB/topics/ekf_gps_position.h uORB/topics/esc_report.h uORB/topics/esc_status.h uORB/topics/estimator_innovations.h uORB/topics/estimator_sensor_bias.h uORB/topics/estimator_status.h uORB/topics/follow_target.h uORB/topics/geofence_result.h uORB/topics/gps_dump.h uORB/topics/gps_inject_data.h uORB/topics/home_position.h uORB/topics/hover_thrust_estimate.h uORB/topics/input_rc.h uORB/topics/iridiumsbd_status.h uORB/topics/irlock_report.h uORB/topics/landing_gear.h uORB/topics/landing_target_innovations.h uORB/topics/landing_target_pose.h uORB/topics/led_control.h uORB/topics/log_message.h uORB/topics/logger_status.h uORB/topics/manual_control_setpoint.h uORB/topics/mavlink_log.h uORB/topics/mission.h uORB/topics/mission_result.h uORB/topics/mount_orientation.h uORB/topics/multirotor_motor_limits.h uORB/topics/obstacle_distance.h uORB/topics/offboard_control_mode.h uORB/topics/onboard_computer_status.h uORB/topics/optical_flow.h uORB/topics/orb_test.h uORB/topics/orb_test_large.h uORB/topics/orb_test_medium.h uORB/topics/orbit_status.h uORB/topics/parameter_update.h uORB/topics/ping.h uORB/topics/position_controller_landing_status.h uORB/topics/position_controller_status.h uORB/topics/position_setpoint.h uORB/topics/position_setpoint_triplet.h uORB/topics/power_button_state.h uORB/topics/power_monitor.h uORB/topics/pwm_input.h uORB/topics/px4io_status.h uORB/topics/qshell_req.h uORB/topics/qshell_retval.h uORB/topics/radio_status.h uORB/topics/rate_ctrl_status.h uORB/topics/rc_channels.h uORB/topics/rc_parameter_map.h uORB/topics/rpm.h uORB/topics/safety.h uORB/topics/satellite_info.h uORB/topics/sensor_accel.h uORB/topics/sensor_accel_fifo.h uORB/topics/sensor_baro.h uORB/topics/sensor_combined.h uORB/topics/sensor_correction.h uORB/topics/sensor_gyro.h uORB/topics/sensor_gyro_fifo.h uORB/topics/sensor_mag.h uORB/topics/sensor_preflight.h uORB/topics/sensor_selection.h uORB/topics/subsystem_info.h uORB/topics/system_power.h uORB/topics/task_stack_info.h uORB/topics/tecs_status.h uORB/topics/telemetry_status.h uORB/topics/test_motor.h uORB/topics/timesync.h uORB/topics/timesync_status.h uORB/topics/trajectory_bezier.h uORB/topics/trajectory_waypoint.h uORB/topics/transponder_report.h uORB/topics/tune_control.h uORB/topics/uavcan_parameter_request.h uORB/topics/uavcan_parameter_value.h uORB/topics/ulog_stream.h uORB/topics/ulog_stream_ack.h uORB/topics/vehicle_acceleration.h uORB/topics/vehicle_air_data.h uORB/topics/vehicle_angular_acceleration.h uORB/topics/vehicle_angular_velocity.h uORB/topics/vehicle_attitude.h uORB/topics/vehicle_attitude_setpoint.h uORB/topics/vehicle_command.h uORB/topics/vehicle_command_ack.h uORB/topics/vehicle_constraints.h uORB/topics/vehicle_control_mode.h uORB/topics/vehicle_global_position.h uORB/topics/vehicle_gps_position.h uORB/topics/vehicle_imu.h uORB/topics/vehicle_imu_status.h uORB/topics/vehicle_land_detected.h uORB/topics/vehicle_local_position.h uORB/topics/vehicle_local_position_setpoint.h uORB/topics/vehicle_magnetometer.h uORB/topics/vehicle_odometry.h uORB/topics/vehicle_rates_setpoint.h uORB/topics/vehicle_roi.h uORB/topics/vehicle_status.h uORB/topics/vehicle_status_flags.h uORB/topics/vehicle_trajectory_bezier.h uORB/topics/vehicle_trajectory_waypoint.h uORB/topics/vtol_vehicle_status.h uORB/topics/wheel_encoders.h uORB/topics/wind_estimate.h uORB/topics/yaw_estimator_status.h

cd /Users/lucasmaley/Firmware/msg && /usr/local/bin/python3 tools/ --headers -f actuator_armed.msg actuator_controls.msg actuator_outputs.msg adc_report.msg airspeed.msg airspeed_validated.msg battery_status.msg camera_capture.msg camera_trigger.msg cellular_status.msg collision_constraints.msg collision_report.msg commander_state.msg cpuload.msg debug_array.msg debug_key_value.msg debug_value.msg debug_vect.msg differential_pressure.msg distance_sensor.msg ekf2_timestamps.msg ekf_gps_drift.msg ekf_gps_position.msg esc_report.msg esc_status.msg estimator_innovations.msg estimator_sensor_bias.msg estimator_status.msg follow_target.msg geofence_result.msg gps_dump.msg gps_inject_data.msg home_position.msg hover_thrust_estimate.msg input_rc.msg iridiumsbd_status.msg irlock_report.msg landing_gear.msg landing_target_innovations.msg landing_target_pose.msg led_control.msg log_message.msg logger_status.msg manual_control_setpoint.msg mavlink_log.msg mission.msg mission_result.msg mount_orientation.msg multirotor_motor_limits.msg obstacle_distance.msg offboard_control_mode.msg onboard_computer_status.msg optical_flow.msg orb_test.msg orb_test_large.msg orb_test_medium.msg orbit_status.msg parameter_update.msg ping.msg position_controller_landing_status.msg position_controller_status.msg position_setpoint.msg position_setpoint_triplet.msg power_button_state.msg power_monitor.msg pwm_input.msg px4io_status.msg qshell_req.msg qshell_retval.msg radio_status.msg rate_ctrl_status.msg rc_channels.msg rc_parameter_map.msg rpm.msg safety.msg satellite_info.msg sensor_accel.msg sensor_accel_fifo.msg sensor_baro.msg sensor_combined.msg sensor_correction.msg sensor_gyro.msg sensor_gyro_fifo.msg sensor_mag.msg sensor_preflight.msg sensor_selection.msg subsystem_info.msg system_power.msg task_stack_info.msg tecs_status.msg telemetry_status.msg test_motor.msg timesync.msg timesync_status.msg trajectory_bezier.msg trajectory_waypoint.msg transponder_report.msg tune_control.msg uavcan_parameter_request.msg uavcan_parameter_value.msg ulog_stream.msg ulog_stream_ack.msg vehicle_acceleration.msg vehicle_air_data.msg vehicle_angular_acceleration.msg vehicle_angular_velocity.msg vehicle_attitude.msg vehicle_attitude_setpoint.msg vehicle_command.msg vehicle_command_ack.msg vehicle_constraints.msg vehicle_control_mode.msg vehicle_global_position.msg vehicle_gps_position.msg vehicle_imu.msg vehicle_imu_status.msg vehicle_land_detected.msg vehicle_local_position.msg vehicle_local_position_setpoint.msg vehicle_magnetometer.msg vehicle_odometry.msg vehicle_rates_setpoint.msg vehicle_roi.msg vehicle_status.msg vehicle_status_flags.msg vehicle_trajectory_bezier.msg vehicle_trajectory_waypoint.msg vtol_vehicle_status.msg wheel_encoders.msg wind_estimate.msg yaw_estimator_status.msg -i /Users/lucasmaley/Firmware/msg -o /Users/lucasmaley/Firmware/build/px4_sitl_default/uORB/topics -e templates/uorb -t /Users/lucasmaley/Firmware/build/px4_sitl_default/msg/tmp/headers -q

Failed to import genmsg: No module named ‘genmsg’

You may need to install it using:

pip3 install --user pyros-genmsg

[13/734] Generating git version header

ninja: build stopped: subcommand failed.

make: *** [px4_sitl] Error 1

I tried running pip3 install --user pyros-genmsg, as that message says, but then it says I already have it.
I have spent a lot of time on forums looking for similar questions and answers but haven’t been able to figure this out.
Any help on this would be greatly appreciated. Please let me know if you need any more information. Thanks

make px4_sitl jmavsim worked for me on Catalina.
GUI came up and I can fly.

What version of python do you have? The module genmsg that it’s telling me I need requires version 2.7, which I have, but then it says that Python 2.7 has reached the end of its life. So when I do make px4_sitl jmavsim I believe the module genmsg can’t be accessed. Also, I have Python 3.8. Thanks!

What branch are you building? mainline will build but release branches have the python issues you are hitting.

I’m not exactly sure what that means. How do I know what branch I’m building? I’m just running make px4_sitl jmavsim in my Firmware directory when I get the error.

Sorry branch is a git thing. They are like different versions of the code.
I would suggest learning about git but that maybe a rabbit hole you don’t wish to explore at this time.
You must have downloaded the zip file like from here:

If you download from here you will get the current snapshot fo mainline, but it changes by the hour as devs check in new code:

Using git you know the version from the branch you checked out.
Not 100% sure how to tell otherwise .
How did you download it?

I just deleted my Firmware directory and re-cloned that branch from the second link you just sent. I then tried make px4_sitl jmavsim after navigating into the new Firmware directory, but got the same error as before. This is really confusing me. I’m pretty sure I have the mainline now, and I think I had it this whole time.

Well I am not sure what your issue is, but tomorrow I have another mac and I will go thru the build set up from scratch. I truly feel your pain to be honest I avoid python just for this very reason - it’s always a fight. Hopefully I will hit your issue.

However I was not 100% correct about branches - I got the 1.11 release branch to build and the sim works. It should build from the normal set up instructions something went wrong with yours.

It’s actually better to use a release branch as things on mainline are in flux.
BTW This is my python version, at least at the build command line:
mbp:Firmware$ python

WARNING: Python 2.7 is not recommended.

This version is included in macOS for compatibility with legacy software.

Future versions of macOS will not include Python 2.7.

Instead, it is recommended that you transition to using ‘python3’ from within Terminal.

Python 2.7.16 (default, Jul 5 2020, 02:24:03)

[GCC 4.2.1 Compatible Apple LLVM 11.0.3 (clang-1103.0.29.21) (-macos10.15-objc- on darwin

Yea, I got a very similar message about python 2.7. I’m guessing that has something to do with the problem. And thanks so much for your help!

Thing is I think the build needs 2.7.16 - regardless of the message. As in legacy software.
2 can live with 3 as you run 3 with python3.
Again, supposition and observation on my part.

I have both 2.7 and 3.8, but I believe the module is only from 2.7 (or at least that version of the module; I’m not exactly sure how it all works, but if there’s a newer version, I don’t have it) which means that the module can’t be accessed when I run make px4_sitl jmavsim.

Here is what I get:
pip3 install --user pyros-genmsg

DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at

Collecting pyros-genmsg

Using cached pyros_genmsg-0.5.8-py2.py3-none-any.whl (25 kB)

Installing collected packages: pyros-genmsg

Successfully installed pyros-genmsg-0.5.8

ip-192-168-10-29:Firmware jcdonelson$

ip-192-168-10-29:Firmware jcdonelson$

ip-192-168-10-29:Firmware jcdonelson$ pip3 install --user pyros-genmsg

DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at

Requirement already satisfied: pyros-genmsg in /Users/jcdonelson/Library/Python/2.7/lib/python/site-packages (0.5.8)

When I do that it just says genmsg is already installed, which is why I keep getting errors. Not sure what’s going on

I have the same problem on Ubuntu 20.04 on a machine where both ROS1 and ROS2 are installed and while running from virtualenvwrapper.
Dependency hell :sweat_smile:

Looks like I’ll go ahead and spin a docker container…