-
Notifications
You must be signed in to change notification settings - Fork 993
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
Unable to Offboard #1644
Comments
@iamrajee What are you trying to achieve? If you don't send setpoints, you will not be able to change your mode into offboard mode since there is no setpoint to track |
I tried to publish the setpoint as below but it didn't help.
But surprisingly when I tried the below script it works:
I'm not sure what I might be doing wrong when manual publishing set point. Also can you please tell me the correct order of "Arming", "Setting Offboard mode" and "publishing set point"? Thank you so much! |
@iamrajee You need to be publishing your setpoint for at least 2Hz in order to switch to offboard mode. Your code is publishing a few setpoints then trying to switch to offboard mode |
Thank you so much @Jaeyoung-Lim, I tried your suggestions and it worked. I'm new to mavros and didn't knew that. I'm describing my steps herewith in case anyone faces a similar issue: (works!) Terminal1:
Terminal4: |
@iamrajee Glad that it worked, and thanks for sharing the solution! |
I'm facing the same issue in melodic as well. However, I couldn't resolve it by the above method. I tried both cpp script and manually publishing setpoint but it dint work. Surprisingly same thing works in noetic. Also. I've tried both binary and source versions of mavros with no luck. Here is how I'm running mavros: Terminal 1: roslaunch mavros px4.launch fcu_url:="udp://:14540@127.0.0.1:14557"
Terminal 2: roslaunch px4 posix_sitl.launch
Terminal 3: rosrun uav_control uav_take_off (above cpp script)
Below are my log Logrosrun mavros checkidOK. I got messages from 1:1. Received 6178 messages, from 1 addresses rostopic echo /mavros/state (Before running arm and offboard)header: rostopic echo /mavros/state (After running arm and offboard)header: rostopic echo -n 1 /diagnosticsheader:
|
I am facing the exact same issue in ROS Melodic. Can anybody confirm/refute that this is an issue with the version? Did you get it working in Melodic @iamrajee? Kind regards |
It seems to be a problem with the current firmware version.
Install tools & dependencies
Edit an error in v1.10.2
please change as following
A usefull script to add paths mavros & SITL: launch_common.sh
and running mavros & SITL
|
@peterminh227 Thank you sharing your solution :) |
My pleasure :D |
Issue details
On running offboard commands, it's not offboarding and gives errors like
time out
andUnexpected command 176
.Command
Terminal1:
roslaunch mavros px4.launch fcu_url:="udp://:14540@127.0.0.1:14557"
Terminal2:
roslaunch px4 posix_sitl.launch
Terminal3:
rosrun mavros mavsafety arm
Terminal4:
rosrun mavros mavsys mode -c OFFBOARD
Errors:
Terminal1:
CMD: Unexpected command 176, result 1
Terminal2:
Terminal3:
No Error
Terminal4:
Timed out!
MAVROS version and platform
ROS: ?Noetic?
Ubuntu: ?20.04?
Autopilot type and version
[ ] PX4
Version: ?3.7.1?
===== > Expand to see: Node logs, Diagnostics & Check ID Output <=======
### Node logs ``` ... logging to /home/rajendra/.ros/log/18daa76e-4087-11ec-b188-d915890be05a/roslaunch-u20-86915.log Checking log directory for disk usage. This may take a while. Press Ctrl-C to interrupt Done checking log file disk usage. Usage is <1GB.started roslaunch server http://u20:40867/
SUMMARY
CLEAR PARAMETERS
PARAMETERS
NODES
/
mavros (mavros/mavros_node)
auto-starting new master
process[master]: started with pid [86935]
ROS_MASTER_URI=http://localhost:11311
setting /run_id to 18daa76e-4087-11ec-b188-d915890be05a
process[rosout-1]: started with pid [86957]
started core service [/rosout]
process[mavros-2]: started with pid [86965]
[ INFO] [1636370953.337379554]: FCU URL: udp://:14540@127.0.0.1:14557
[ INFO] [1636370953.338554393]: udp0: Bind address: 0.0.0.0:14540
[ INFO] [1636370953.338588363]: udp0: Remote address: 127.0.0.1:14557
[ INFO] [1636370953.338653668]: GCS bridge disabled
[ INFO] [1636370953.344637127]: Plugin 3dr_radio loaded
[ INFO] [1636370953.345229702]: Plugin 3dr_radio initialized
[ INFO] [1636370953.345260797]: Plugin actuator_control loaded
[ INFO] [1636370953.346531315]: Plugin actuator_control initialized
[ INFO] [1636370953.348686356]: Plugin adsb loaded
[ INFO] [1636370953.350249280]: Plugin adsb initialized
[ INFO] [1636370953.350298662]: Plugin altitude loaded
[ INFO] [1636370953.350787542]: Plugin altitude initialized
[ INFO] [1636370953.350825836]: Plugin cam_imu_sync loaded
[ INFO] [1636370953.351143715]: Plugin cam_imu_sync initialized
[ INFO] [1636370953.351238120]: Plugin command loaded
[ INFO] [1636370953.354342777]: Plugin command initialized
[ INFO] [1636370953.354415274]: Plugin companion_process_status loaded
[ INFO] [1636370953.355708975]: Plugin companion_process_status initialized
[ INFO] [1636370953.355780504]: Plugin debug_value loaded
[ INFO] [1636370953.357896568]: Plugin debug_value initialized
[ INFO] [1636370953.357914016]: Plugin distance_sensor blacklisted
[ INFO] [1636370953.357982266]: Plugin esc_status loaded
[ INFO] [1636370953.358564021]: Plugin esc_status initialized
[ INFO] [1636370953.358641378]: Plugin esc_telemetry loaded
[ INFO] [1636370953.358939999]: Plugin esc_telemetry initialized
[ INFO] [1636370953.359027319]: Plugin fake_gps loaded
[ INFO] [1636370953.366722431]: Plugin fake_gps initialized
[ INFO] [1636370953.366807277]: Plugin ftp loaded
[ INFO] [1636370953.369959456]: Plugin ftp initialized
[ INFO] [1636370953.370032120]: Plugin geofence loaded
[ INFO] [1636370953.371490409]: Plugin geofence initialized
[ INFO] [1636370953.371567068]: Plugin global_position loaded
[ INFO] [1636370953.379730890]: Plugin global_position initialized
[ INFO] [1636370953.379803892]: Plugin gps_input loaded
[ INFO] [1636370953.381226136]: Plugin gps_input initialized
[ INFO] [1636370953.381299174]: Plugin gps_rtk loaded
[ INFO] [1636370953.382655862]: Plugin gps_rtk initialized
[ INFO] [1636370953.382735016]: Plugin gps_status loaded
[ INFO] [1636370953.383937501]: Plugin gps_status initialized
[ INFO] [1636370953.384012134]: Plugin hil loaded
[ INFO] [1636370953.390284194]: Plugin hil initialized
[ INFO] [1636370953.390358809]: Plugin home_position loaded
[ INFO] [1636370953.392139148]: Plugin home_position initialized
[ INFO] [1636370953.392188020]: Plugin imu loaded
[ INFO] [1636370953.395839831]: Plugin imu initialized
[ INFO] [1636370953.395885965]: Plugin landing_target loaded
[ INFO] [1636370953.402558907]: Plugin landing_target initialized
[ INFO] [1636370953.402636775]: Plugin local_position loaded
[ INFO] [1636370953.405978119]: Plugin local_position initialized
[ INFO] [1636370953.406046740]: Plugin log_transfer loaded
[ INFO] [1636370953.407635219]: Plugin log_transfer initialized
[ INFO] [1636370953.407706050]: Plugin mag_calibration_status loaded
[ INFO] [1636370953.408532198]: Plugin mag_calibration_status initialized
[ INFO] [1636370953.408608057]: Plugin manual_control loaded
[ INFO] [1636370953.410557452]: Plugin manual_control initialized
[ INFO] [1636370953.410623550]: Plugin mocap_pose_estimate loaded
[ INFO] [1636370953.412570183]: Plugin mocap_pose_estimate initialized
[ INFO] [1636370953.412616839]: Plugin mount_control loaded
[ INFO] [1636370953.414478274]: Plugin mount_control initialized
[ INFO] [1636370953.414528324]: Plugin nav_controller_output loaded
[ INFO] [1636370953.415322558]: Plugin nav_controller_output initialized
[ INFO] [1636370953.415369991]: Plugin obstacle_distance loaded
[ INFO] [1636370953.416799441]: Plugin obstacle_distance initialized
[ INFO] [1636370953.416842831]: Plugin odom loaded
[ INFO] [1636370953.418902424]: Plugin odom initialized
[ INFO] [1636370953.418949060]: Plugin onboard_computer_status loaded
[ INFO] [1636370953.420092997]: Plugin onboard_computer_status initialized
[ INFO] [1636370953.420143455]: Plugin param loaded
[ INFO] [1636370953.421683008]: Plugin param initialized
[ INFO] [1636370953.421729172]: Plugin play_tune loaded
[ INFO] [1636370953.423481387]: Plugin play_tune initialized
[ INFO] [1636370953.423526233]: Plugin px4flow loaded
[ INFO] [1636370953.426912991]: Plugin px4flow initialized
[ INFO] [1636370953.426965817]: Plugin rallypoint loaded
[ INFO] [1636370953.428381960]: Plugin rallypoint initialized
[ INFO] [1636370953.428400111]: Plugin rangefinder blacklisted
[ INFO] [1636370953.428449084]: Plugin rc_io loaded
[ INFO] [1636370953.430169743]: Plugin rc_io initialized
[ INFO] [1636370953.430186083]: Plugin safety_area blacklisted
[ INFO] [1636370953.430239832]: Plugin setpoint_accel loaded
[ INFO] [1636370953.431712237]: Plugin setpoint_accel initialized
[ INFO] [1636370953.431764933]: Plugin setpoint_attitude loaded
[ INFO] [1636370953.436787050]: Plugin setpoint_attitude initialized
[ INFO] [1636370953.436843061]: Plugin setpoint_position loaded
[ INFO] [1636370953.444695079]: Plugin setpoint_position initialized
[ INFO] [1636370953.444749019]: Plugin setpoint_raw loaded
[ INFO] [1636370953.448981401]: Plugin setpoint_raw initialized
[ INFO] [1636370953.449039607]: Plugin setpoint_trajectory loaded
[ INFO] [1636370953.451888522]: Plugin setpoint_trajectory initialized
[ INFO] [1636370953.451947705]: Plugin setpoint_velocity loaded
[ INFO] [1636370953.454700339]: Plugin setpoint_velocity initialized
[ INFO] [1636370953.454775349]: Plugin sys_status loaded
[ INFO] [1636370953.460130088]: Plugin sys_status initialized
[ INFO] [1636370953.460193739]: Plugin sys_time loaded
[ INFO] [1636370953.462800523]: TM: Timesync mode: MAVLINK
[ INFO] [1636370953.462980192]: TM: Not publishing sim time
[ INFO] [1636370953.463493991]: Plugin sys_time initialized
[ INFO] [1636370953.463546019]: Plugin trajectory loaded
[ INFO] [1636370953.466134952]: Plugin trajectory initialized
[ INFO] [1636370953.466184619]: Plugin tunnel loaded
[ INFO] [1636370953.467601361]: Plugin tunnel initialized
[ INFO] [1636370953.467656896]: Plugin vfr_hud loaded
[ INFO] [1636370953.467943191]: Plugin vfr_hud initialized
[ INFO] [1636370953.467964132]: Plugin vibration blacklisted
[ INFO] [1636370953.468013825]: Plugin vision_pose_estimate loaded
[ INFO] [1636370953.471496581]: Plugin vision_pose_estimate initialized
[ INFO] [1636370953.471549667]: Plugin vision_speed_estimate loaded
[ INFO] [1636370953.473181368]: Plugin vision_speed_estimate initialized
[ INFO] [1636370953.473234360]: Plugin waypoint loaded
[ INFO] [1636370953.475488740]: Plugin waypoint initialized
[ INFO] [1636370953.475512220]: Plugin wheel_odometry blacklisted
[ INFO] [1636370953.475565594]: Plugin wind_estimation loaded
[ INFO] [1636370953.475875658]: Plugin wind_estimation initialized
[ INFO] [1636370953.475899715]: Autostarting mavlink via USB on PX4
[ INFO] [1636370953.475925073]: Built-in SIMD instructions: SSE, SSE2
[ INFO] [1636370953.475939586]: Built-in MAVLink package version: 2021.9.9
[ INFO] [1636370953.475955560]: Known MAVLink dialects: common ardupilotmega ASLUAV all development icarous matrixpilot paparazzi standard uAvionix ualberta
[ INFO] [1636370953.476000700]: MAVROS started. MY ID 1.240, TARGET ID 1.1
[ INFO] [1636370957.598001363]: udp0: Remote address: 127.0.0.1:14580
[ INFO] [1636370957.598108186]: IMU: High resolution IMU detected!
[ INFO] [1636370958.583735245]: CON: Got HEARTBEAT, connected. FCU: PX4 Autopilot
[ INFO] [1636370958.586685253]: IMU: High resolution IMU detected!
[ INFO] [1636370959.595795761]: GF: Using MISSION_ITEM_INT
[ INFO] [1636370959.595916362]: RP: Using MISSION_ITEM_INT
[ INFO] [1636370959.596008041]: WP: Using MISSION_ITEM_INT
[ INFO] [1636370959.596153706]: VER: 1.1: Capabilities 0x000000000000e4ef
[ INFO] [1636370959.596527388]: VER: 1.1: Flight software: 010d0000 (f9cfcc5cfa000000)
[ INFO] [1636370959.596653307]: VER: 1.1: Middleware software: 010d0000 (f9cfcc5cfa000000)
[ INFO] [1636370959.596766877]: VER: 1.1: OS software: 050b00ff (ca1938fbcccc1a0a)
[ INFO] [1636370959.596844121]: VER: 1.1: Board hardware: 00000001
[ INFO] [1636370959.596914584]: VER: 1.1: VID/PID: 0000:0000
[ INFO] [1636370959.596992308]: VER: 1.1: UID: 4954414c44494e4f
[ WARN] [1636370959.599783265]: CMD: Unexpected command 520, result 0
[ INFO] [1636370961.681557341]: IMU: Attitude quaternion IMU detected!
[ INFO] [1636370973.584681805]: GF: mission received
[ INFO] [1636370973.585601544]: RP: mission received
[ INFO] [1636370973.586278057]: WP: mission received
[ WARN] [1636370982.193006279]: CMD: Unexpected command 176, result 1
[ WARN] [1636371132.274533726]: CMD: Unexpected command 176, result 1
[ WARN] [1636371150.539472021]: CMD: Unexpected command 176, result 1
header:
seq: 593
stamp:
secs: 1636371755
nsecs: 476583860
frame_id: ''
status:
level: 0
name: "mavros: GPS"
message: "3D fix"
hardware_id: "udp://:14540@127.0.0.1:14557"
values:
value: "3"
value: "0.00"
value: "0.00"
level: 0
name: "mavros: Heartbeat"
message: "Normal"
hardware_id: "udp://:14540@127.0.0.1:14557"
values:
value: "1.037023"
value: "Quadrotor"
value: "PX4 Autopilot"
value: "AUTO.LOITER"
value: "Standby"
level: 2
name: "mavros: System"
message: "Sensor health"
hardware_id: "udp://:14540@127.0.0.1:14557"
values:
value: "0x1021000C"
value: "0x102E002F"
value: "Ok"
value: "Ok"
value: "Fail"
value: "Ok"
value: "Ok"
value: "26.0"
value: "0.0"
value: "0"
value: "0"
value: "0"
value: "0"
value: "0"
level: 0
name: "mavros: Battery"
message: "Normal"
hardware_id: "udp://:14540@127.0.0.1:14557"
values:
value: "-1.0"
value: "51.0"
level: 0
name: "mavros: Time Sync"
message: "Normal"
hardware_id: "udp://:14540@127.0.0.1:14557"
values:
value: "9.999868"
value: "0.277060"
value: "0.302375"
value: "797.328000000"
value: "1636370958.136772394"
OK. I got messages from 1:1.
Received 6150 messages, from 1 addresses
sys:comp list of messages
Exception in thread Thread-5:
Traceback (most recent call last):
File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
File "/opt/ros/noetic/lib/python3/dist-packages/rospy/timer.py", line 237, in run
self._callback(TimerEvent(last_expected, last_real, current_expected, current_real, last_duration))
File "/home/rajendra/drone_ws/src/mavros/mavros/scripts/checkid", line 82, in timer_cb
for address, messages in self.message_sources.iteritems():
AttributeError: 'dict' object has no attribute 'iteritems'
The text was updated successfully, but these errors were encountered: