Describe the bug
In SITL ROS with gazebo: After launching the simulation, the drone can not be armed. The error statements say: "Primary accelerometer not found" if I try to arm, the I get "Arm/Disarm temporarily rejected"
This happens for any Firmware version after this commit
To Reproduce
Steps to reproduce the behavior:
I used the following launch file from inside the local_planner package.
<param name="use_sim_time" value="true" />
<!-- Launch PX4 SITL -->
<include file="$(find px4)/launch/px4.launch">
</include>
<!-- Launch MavROS -->
<group ns="$(arg ns)">
<include file="$(find mavros)/launch/node.launch">
<arg name="pluginlists_yaml" value="$(find mavros)/launch/px4_pluginlists.yaml" />
<!-- Need to change the config file to get the tf topic and get local position in terms of local origin -->
<arg name="config_yaml" value="$(find local_planner)/resource/px4_config.yaml" />
<arg name="fcu_url" value="$(arg fcu_url)" />
<arg name="gcs_url" value="$(arg gcs_url)" />
<arg name="tgt_system" value="$(arg tgt_system)" />
<arg name="tgt_component" value="$(arg tgt_component)" />
</include>
</group>
<!-- Launch Gazebo -->
<include file="$(find gazebo_ros)/launch/empty_world.launch">
<arg name="headless" value="$(arg headless)"/>
<arg name="gui" value="$(arg gui)"/>
<arg name="world_name" value="$(arg world_path)" />
</include>
<!-- Spawn iris with depth camera -->
<node name="spawn_model" pkg="gazebo_ros" type="spawn_model" output="screen"
args="-sdf -database $(arg model) -model iris">
</node>
Expected behavior
I would expect the drone to arm and be operational
@dagar @baumanta I saw this as well. The problem is that the parameters are not correctly loaded and CAL_*_PRIME is always 0.
If you need to get it to work, manually set those parameters to the correct values
Let's get something in the CI system representative of this usage.
I thought you would have hit the default parameters here https://github.com/PX4/Firmware/blob/master/ROMFS/px4fmu_common/init.d-posix/rcS#L98, but apparently not.
@dagar @baumanta - I did a bit of debugging with @julianoes . Here's what we figured out
On a clean build of make posix_sitl_default gazebo AUTOCNF is true and the parameters CAL*_PRIME are set. Those parameters are saved into ~/Firmware/build/posix_sitl_default/tmp/rootfs/eeprom/parameters.
Now that the Firmware is built, we start the avoidance. The launch script is in the initial comment of the issue. AUTOCNF is false because it isn't a new build and the parameters are retrieved from the saved paramters file. However when starting PX4 from ROS the used file is not ~/Firmware/build/posix_sitl_default/tmp/rootfs/eeprom/parameters but ~/.ros/eeprom/parameters (which still contains the parameters from the old Fimware).
To fix the issue you either need to remove the parameter file in ~/.ros or run catkin purge to wipe the ~/.ros folder. catkin clean is not enough since it only effects the build folder of the catkin workspace.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Closing as stale.
This is still an issue. If the vehicle type is changed from ros, the new parameters specific to that vehicle are not loaded correctly. Deleting ~/.ros/eeprom/parameters make the new parameters load
Not stale, this just cost me 1h!
@dagar this is a quite annoying issue for anyone using ROS. I try to fix it without success. Could you look into this?
It broke with one of your refactors. Incriminated commit https://github.com/PX4/Firmware/commit/c7e572d2c2bb21ae3dfdbff637022946d9f9b72c
This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.
@baumanta is still an issue?
@julianoes I'm actually not sure. I have not used SITL in months
Yeah this is still an issue
Yeah this is still an issue
What are you seeing exactly and how often?
From running gazebo SITL on master:
ERROR [sensors] fewer accels than calibrations, resetting all CAL_GYROx_ID
After this, sim loading just freezed, presumably because it was waiting for lockstep which never happened. Got same error on restart, it didn't actually seem to be resetting the param.
Another weird thing is that it says accel, but apparently tries to reset gyro params?
Remove ~/.ros fixed it.
This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.
Finally resolved in master?
Please reopen if this is still an issue.