Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use iris_opt_flow for Auto Modes in Gazebo SITL #305

Closed
bozkurthan opened this issue Mar 25, 2019 · 3 comments
Closed

Cannot use iris_opt_flow for Auto Modes in Gazebo SITL #305

bozkurthan opened this issue Mar 25, 2019 · 3 comments

Comments

@bozkurthan
Copy link
Contributor

bozkurthan commented Mar 25, 2019

I've problem with optical flow camera in Gazebo Simulation. I tried some Flight modes in Simulation but most of them are not able to use. E.g. MISSION, HOLD. Only I can send TAKEOFF command and Optical Flow Camera works fine with this command. But somehow when I send MISSION or HOLD, Iris is rejecting these modes. Furthermore, I opened Analyze on QGroundControl and saw very different values between LOCAL_POSITION_NED.x and POSTION_TARGET_LOCAL_NED.x when I sent ALTITUDE mode command. Iris starts slowly freefall when I change mode from TAKEOFF to ALTITUDE

Screenshot from 2019-03-25 11-06-03
POSTION_TARGET_LOCAL_NED.x goes up because of mode change from TAKEOFF to ALTITUDE

Terminal LOGs:

abnasuh@abnasuh-AS:~/src/Firmware$ sudo make posix gazebo_iris_opt_flow
[2/6] Performing configure step for 'sitl_gazebo'
-- install-prefix: /usr/local
-- Boost version: 1.58.0
-- Found the following Boost libraries:
--   system
--   thread
--   timer
--   filesystem
--   chrono
--   date_time
--   atomic
-- Boost version: 1.58.0
-- Found the following Boost libraries:
--   thread
--   system
--   filesystem
--   program_options
--   regex
--   iostreams
--   date_time
--   chrono
--   atomic
-- Boost version: 1.58.0
-- Looking for OGRE...
-- Found Ogre Ghadamon (1.9.0)
-- Looking for OGRE_Paging...
-- Found OGRE_Paging: optimized;/usr/lib/x86_64-linux-gnu/libOgrePaging.so;debug;/usr/lib/x86_64-linux-gnu/libOgrePaging.so
-- Looking for OGRE_Terrain...
-- Found OGRE_Terrain: optimized;/usr/lib/x86_64-linux-gnu/libOgreTerrain.so;debug;/usr/lib/x86_64-linux-gnu/libOgreTerrain.so
-- Looking for OGRE_Property...
-- Found OGRE_Property: optimized;/usr/lib/x86_64-linux-gnu/libOgreProperty.so;debug;/usr/lib/x86_64-linux-gnu/libOgreProperty.so
-- Looking for OGRE_RTShaderSystem...
-- Found OGRE_RTShaderSystem: optimized;/usr/lib/x86_64-linux-gnu/libOgreRTShaderSystem.so;debug;/usr/lib/x86_64-linux-gnu/libOgreRTShaderSystem.so
-- Looking for OGRE_Volume...
-- Found OGRE_Volume: optimized;/usr/lib/x86_64-linux-gnu/libOgreVolume.so;debug;/usr/lib/x86_64-linux-gnu/libOgreVolume.so
-- Looking for OGRE_Overlay...
-- Found OGRE_Overlay: optimized;/usr/lib/x86_64-linux-gnu/libOgreOverlay.so;debug;/usr/lib/x86_64-linux-gnu/libOgreOverlay.so
-- Found Protobuf: /usr/lib/x86_64-linux-gnu/libprotobuf.so (Required is at least version "2.3.0") 
-- Config-file not installed for ZeroMQ -- checking for pkg-config
-- Checking for module 'libzmq >= 4'
--   Found libzmq , version 4.1.4
-- Checking for module 'uuid'
--   Found uuid, version 2.27.0
-- Checking for module 'tinyxml2'
--   Found tinyxml2, version 2.2.0
-- Looking for dlfcn.h - found
-- Looking for libdl - found
-- FreeImage.pc not found, we will search for FreeImage_INCLUDE_DIRS and FreeImage_LIBRARIES
-- Checking for module 'gts'
--   Found gts, version 0.7.6
-- Checking for module 'libswscale'
--   Found libswscale, version 3.1.101
-- Checking for module 'libavdevice >= 56.4.100'
--   Found libavdevice , version 56.4.100
-- Checking for module 'libavformat'
--   Found libavformat, version 56.40.101
-- Checking for module 'libavcodec'
--   Found libavcodec, version 56.60.100
-- Checking for module 'libavutil'
--   Found libavutil, version 54.31.100
-- Checking for module 'jsoncpp'
--   Found jsoncpp, version 1.7.2
-- Checking for module 'yaml-0.1'
--   Found yaml-0.1, version 0.1.6
-- Checking for module 'libzip'
--   Found libzip, version 1.0.1
-- Building klt_feature_tracker without catkin
-- Building OpticalFlow with OpenCV
-- catkin DISABLED
-- Found Protobuf: /usr/lib/x86_64-linux-gnu/libprotobuf.so  
Gazebo version: 9.6
-- Using C++14 compiler
-- Configuring done
-- Generating done
-- Build files have been written to: /home/abnasuh/src/Firmware/build/px4_sitl_default/build_gazebo
[3/6] Performing build step for 'sitl_gazebo'
ninja: no work to do.
[6/6] cd /home/abnasuh/src/Firmware/bu...uh/src/Firmware/build/px4_sitl_default
SITL ARGS
sitl_bin: /home/abnasuh/src/Firmware/build/px4_sitl_default/bin/px4
debugger: none
program: gazebo
model: iris_opt_flow
src_path: /home/abnasuh/src/Firmware
build_path: /home/abnasuh/src/Firmware/build/px4_sitl_default
GAZEBO_PLUGIN_PATH :/home/abnasuh/src/Firmware/build/px4_sitl_default/build_gazebo
GAZEBO_MODEL_PATH :/home/abnasuh/src/Firmware/Tools/sitl_gazebo/models
LD_LIBRARY_PATH :/home/abnasuh/src/Firmware/build/px4_sitl_default/build_gazebo
Gazebo multi-robot simulator, version 9.6.0
Copyright (C) 2012 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org

[Msg] Waiting for master.
[Msg] Connected to gazebo master @ http://127.0.0.1:11345
[Msg] Publicized address: 192.168.42.116
[Dbg] [gazebo_mavlink_interface.cpp:137] <joint_name> not found for channel[0] no joint control will be performed for this channel.
[Dbg] [gazebo_mavlink_interface.cpp:137] <joint_name> not found for channel[1] no joint control will be performed for this channel.
[Dbg] [gazebo_mavlink_interface.cpp:137] <joint_name> not found for channel[2] no joint control will be performed for this channel.
[Dbg] [gazebo_mavlink_interface.cpp:137] <joint_name> not found for channel[3] no joint control will be performed for this channel.
[Wrn] [gazebo_mavlink_interface.cpp:126] joint [zephyr_delta_wing::propeller_joint] not found for channel[4] no joint control for this channel.
[Wrn] [gazebo_mavlink_interface.cpp:126] joint [zephyr_delta_wing::flap_left_joint] not found for channel[5] no joint control for this channel.
[Wrn] [gazebo_mavlink_interface.cpp:126] joint [zephyr_delta_wing::flap_right_joint] not found for channel[6] no joint control for this channel.
[Dbg] [gazebo_mavlink_interface.cpp:137] <joint_name> not found for channel[7] no joint control will be performed for this channel.
[Msg] Conecting to PX4 SITL using TCP
[Msg] Lockstep is enabled
[Msg] Speed factor set to: 1
SITL COMMAND: "/home/abnasuh/src/Firmware/build/px4_sitl_default/bin/px4" "/home/abnasuh/src/Firmware"/ROMFS/px4fmu_common -s etc/init.d-posix/rcS -t "/home/abnasuh/src/Firmware"/test_data
INFO  [px4] Creating symlink /home/abnasuh/src/Firmware/ROMFS/px4fmu_common -> /home/abnasuh/src/Firmware/build/px4_sitl_default/tmp/rootfs/etc

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

px4 starting.

INFO  [px4] Calling startup script: /bin/sh etc/init.d-posix/rcS 0
INFO  [dataman] Unknown restart, data manager file './dataman' size is 11798680 bytes
INFO  [simulator] Waiting for simulator to connect on TCP port 4560
INFO  [simulator] Simulator connected on TCP port 4560.
[Msg] Using MAVLink protocol v2.0
[Wrn] [Publisher.cc:141] Queue limit reached for topic /gazebo/default/iris_opt_flow/motor_speed/0, deleting message. This warning is printed only once.
[Wrn] [RaySensor.cc:288] ranges not constructed yet (zero sized)
Gazebo multi-robot simulator, version 9.6.0
Copyright (C) 2012 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org

[Msg] Waiting for master.
[Msg] Connected to gazebo master @ http://127.0.0.1:11345
[Msg] Publicized address: 192.168.42.116
INFO  [commander] Mission #2 loaded, 4 WPs, curr: 0
INFO  [init] Mixer: etc/mixers/quad_w.main.mix on /dev/pwm_output0
INFO  [ekf2] Found range finder with instance 0
INFO  [mavlink] mode: Normal, data rate: 4000000 B/s on udp port 14570 remote port 14550
INFO  [mavlink] mode: Onboard, data rate: 4000000 B/s on udp port 14580 remote port 14540
INFO  [logger] logger started (mode=all)
INFO  [logger] Start file log (type: full)
INFO  [logger] Opened full log file: ./log/2019-03-25/08_04_37.ulg
INFO  [mavlink] MAVLink only on localhost (set param MAV_BROADCAST = 1 to enable network)
INFO  [px4] Startup script returned successfully
pxh> INFO  [mavlink] partner IP: 127.0.0.1
INFO  [ecl/EKF] EKF aligned, (pressure height, IMU buf: 22, OBS buf: 14)
WARN  [mc_pos_control] Auto activation failed with error: Activation Failed
INFO  [commander] Takeoff detected
Number of good matches: 1, desired: 14
Number of good matches: 1, desired: 12
Number of good matches: 3, desired: 6
Number of good matches: 1, desired: 3
Number of good matches: 3, desired: 3
Number of good matches: 3, desired: 3
Number of good matches: 3, desired: 3
Number of good matches: 1, desired: 1
Number of good matches: 3, desired: 3
Number of good matches: 3, desired: 3
Number of good matches: 2, desired: 2
Number of good matches: 3, desired: 3
Number of good matches: 2, desired: 2
Number of good matches: 4, desired: 4
Number of good matches: 3, desired: 3
Number of good matches: 5, desired: 5
Number of good matches: 3, desired: 3
Number of good matches: 1, desired: 9
Number of good matches: 1, desired: 16
Number of good matches: 1, desired: 15
INFO  [commander] Landing detected
INFO  [logger] closed logfile, bytes written: 3314637
[Wrn] [Publisher.cc:141] Queue limit reached for topic /gazebo/default/iris_opt_flow/motor_speed/1, deleting message. This warning is printed only once.
[Wrn] [Publisher.cc:141] Queue limit reached for topic /gazebo/default/iris_opt_flow/motors, deleting message. This warning is printed only once.
[Wrn] [Publisher.cc:141] Queue limit reached for topic /gazebo/default/iris_opt_flow/motor_speed/2, deleting message. This warning is printed only once.
[Wrn] [Publisher.cc:141] Queue limit reached for topic /gazebo/default/iris_opt_flow/motor_speed/3, deleting message. This warning is printed only once.
WARN  [commander] MANUAL CONTROL LOST (at t=196748ms)
WARN  [commander] MANUAL CONTROL LOST (at t=205880ms)
WARN  [commander] MANUAL CONTROL LOST (at t=235700ms)

Flight log with same state but another flight:
https://review.px4.io/plot_app?log=e80b5741-550d-4d93-b04b-9395d53e5197

@bozkurthan
Copy link
Contributor Author

OK. The problem is that mission needs Home Position for flight. On the other hand, I don't know why Iris doesn't receive HOLD mode without GPS.

In order to perform Mission I changed parameter that named EKF2_AID_MASK.
Before change:
Screenshot from 2019-03-26 08-55-24

After change:
Screenshot from 2019-03-26 08-55-38

And waited for home position. Then, closed gps from terminal.
Screenshot from 2019-03-26 09-31-52

After all this step, Iris accepted HOLD and MISSION modes.

The whole steps should be like this or is this problem?

@lamping7
Copy link
Member

I think it's a problem. Mentioned here --> PX4/PX4-Autopilot#11665

@bozkurthan
Copy link
Contributor Author

I'm closing thanks @lamping7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants