mavlink / mavros

MAVLink to ROS gateway with proxy for Ground Control Station
Other
900 stars 994 forks source link

"Time out" or " Mode changed" when use offboard mode #314

Closed wangsen1312 closed 9 years ago

wangsen1312 commented 9 years ago

I send a stream of setpoints and tried offboard mode using command ''rosrun mavros mavsys mode -c OFFBOARD". It shows "Time out" or "Mode changed". The UAV move unstablized and cannot takeoff. Can someone give me suggestion, Thank you very much!

vooon commented 9 years ago

/diagnostics please!

wangsen1312 commented 9 years ago

@vooon @TSC21 Thank for your help. My main purpose is control the UAV fly to the position which offered by mocap. I use new stable PX4 firmware installed yesterday, 3DRradio connect to UAV directly without any onboard computer.

1) The first stage seems OK now. I use Vicon_bridge get the mocap data and publish the data to vision_pose/pose, and I change the INAV's parameters, only left the CBRK_no_vision = 0, vision weight max value 10, others are zero. Now I can get the /mavros/local_position/local data as Vicon system offers.

2) Now I want to set local postition for my UAV. I do following steps: a. arm the UAV first (it works well) rosrun mavros mavsafety arm b. sending a stream of setpoints (I use the the demo set point https://raw.githubusercontent.com/kuri-kustar/indoor_uav_control/master/scripts/setpoint_demo_2.py), which seems OK.

c. request offboard rosrun mavros mavsys mode -c OFFBOARD This is the problem I meet, the quad is not taking off as I wish and not stablized and sometimes show "Time out". I only use demo to set positions, should I change some other parameters to stablize the UAV?

The /diagnostics file is below:

header: seq: 78 stamp: secs: 1434983924 nsecs: 567774546 frame_id: '' status:

By the way, after radio connect to UAV, some error information occurs, such as [ERROR] [1434915513.490270708]: FCU: REJ. WP CMD: partner id mismatch I don't know it will cause something wrong or not?

Can you give me some suggestion? Thank you very much.

mhkabir commented 9 years ago

Check if your local position estimates (LOCAL_POSITION_NED message) match your mocap data. I have a strong suspicion that setting weights to zero in INAV is causing a bad estimate.

And the timeouts are likely because the 3DR radio doesn't have nearly enough bandwidth to be used for streaming vicon + setpoints. You need better radios like LairdTech ones.

Royalcheese commented 9 years ago

Or use ODROID onboard + WIFI + ROS network :)

wangsen1312 commented 9 years ago

@mhkabir @Royalcheese @vooon Thank you for your suggestion. I have check the local position, which is matched with my mocap data. I have reduce the frequency to 20HZ and the timeout cannot be seen, but the UAV cannot take off either. The propeller changed their speed but cannot take off! Have you ever tried use mavros to take off? or I should do something else before take off? How can you try the offboard Mode? Thank you very much!

Royalcheese commented 9 years ago

I think, it is because PID parameters have to be set following the weight of your drone , as i told you by mail. If you have a look on equations which are the basis of mc_pos_control, you'll see that there is the weight taken in count. but in the controller, you only control the Thrust, without taking care of the inertial characteristics of your uav. I guess you have to set proportional parameters the proper way in order to compensate weight, and this is that why I've tried to make a scilab simulation of the controller , to find the good parameters including the inertial characteristics. But you can also do it step by step, increasing proportional part of controller incrementally until it takes off. but it can be "dangerous" cause of unstability induced by proportional controller ( I think.. ).

vooon commented 9 years ago

Updates?

wangsen1312 commented 9 years ago

@vooon I don't know why TImeout see again. The UAV cannot takeoff with mavros? Have you ever try to use the mavros to make the UAV takeoff first without GPS?

vooon commented 9 years ago

FCU armed?

wangsen1312 commented 9 years ago

@vooon arm works well. Now it cannot follow the set local position command.

vooon commented 9 years ago

Hmm, strange. Please don't use master now. Seems that transform are broken...

Royalcheese commented 9 years ago

@vooon You mean the tf of ROS ?

TSC21 commented 9 years ago

You have to limit the tf publishing rate or it will result in timeouts

wangsen1312 commented 9 years ago

@vooon @mhkabir @TSC21 I find it's hard to takeoff from floor so have tested another method: 1) use MANUAL mode to take off and stabilize. 2) Send local position stream 3) change to the OFFBOARD mode using RC I find something dangerous happen, UAV fly to some position far away from setting position. Do you think the set_local_position function works well when I use VICON replace INAV vision parameters?

vooon commented 9 years ago

Bug #273 still opened, but there workaround in mavros.

LorenzMeier commented 9 years ago

It was fixed on the Firmware side and I consequently closed it.

LorenzMeier commented 9 years ago

@Royalcheese That comment should be removed consequently.

TSC21 commented 9 years ago

@LorenzMeier @Royalcheese we will remove comment soon then.