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

PX4 connection test #68

Closed
7 tasks done
vooon opened this issue Jul 26, 2014 · 38 comments
Closed
7 tasks done

PX4 connection test #68

vooon opened this issue Jul 26, 2014 · 38 comments
Labels
Milestone

Comments

@vooon
Copy link
Member

vooon commented Jul 26, 2014

I've got my clone. It comes with APM:Copter 3.1.4, test connections: same as my APM2.6 (works).

Now i install current git master of PX4/Firmware.

  • param
  • waypoint
  • command
  • rc_io
  • gps
  • imu_pub
  • sys_status

Related #48.

@vooon vooon added this to the Version 0.7.0 milestone Jul 26, 2014
@vooon vooon added the PX4 label Jul 26, 2014
@vooon
Copy link
Member Author

vooon commented Jul 26, 2014

Imu_pub sends data_raw only. Need read documentation how to configure firmware.

gps: don't have compatible connector, require solder iron...

param: don't respond to param request, maybe i must reset param storage?

sys_status: todo: implement mode decoding.

USB quirk sometime don't work, but manual start works.

@mhkabir
Copy link
Member

mhkabir commented Jul 27, 2014

@vooon I am using release 0.6.0 as later versions with libev slowdown high-rate publishers. Please look into it.
USB quirk doesn't work as I've noticed too sometimes. Sometimes manual doesn't work also :( How do you do it in manual? Can you send me a bash script for it?
IMU_Pub sends data and data_raw(on 0.6.0 atleast) for me.

@vooon
Copy link
Member Author

vooon commented Jul 27, 2014

@mhkabir For manual init i just connect to nsh via minicom, then call /etc/init.d/rc.usb (same as USB quirk do).

Please add instructions how configure for that high rate.

@mhkabir
Copy link
Member

mhkabir commented Jul 27, 2014

Okay. I have observed that if I leave the PX4 for say 15 mins or so without starting mavlink, even manual starting does not work. Minicom cannot even open NSH...

You can set stream rates for ATTITUDE and HIGHRES_IMU to 200 to test highrate problem in Libev

@TSC21
Copy link
Member

TSC21 commented Jul 27, 2014

Still using 0.6 also, as position lock gives me a shut on connection in 0.7 (with libev).

@vooon
Copy link
Member Author

vooon commented Jul 28, 2014

@mhkabir Can you send you SD card configs?

vooon added a commit that referenced this issue Aug 5, 2014
Also waypoint plugin works (with first_pos_control_flight-5273-gd3d5aa9).
Issue #68.
@vooon
Copy link
Member Author

vooon commented Aug 5, 2014

Testing current master (first_pos_control_flight-5273-gd3d5aa9).
Waypoint plugin now works, but parameter request now broken.
When QGC request params, param catch it too, but FW simply not respond to PARAM_REQUEST_LIST from plugin (with silence).

@vooon
Copy link
Member Author

vooon commented Aug 5, 2014

Also FW sends SYSTEM_STATUS with 0 in sensor health fields. No attitude message by default.

@TSC21
Copy link
Member

TSC21 commented Aug 5, 2014

Alwasy get, after running roslaunch mavros px4.launch:

[ INFO] [1407272109.533467981]: CON: Got HEARTBEAT, connected.
[ WARN] [1407272120.537521636]: PR: request list timeout, retries left 2
[ WARN] [1407272121.538459819]: PR: request list timeout, retries left 1
[ WARN] [1407272122.538817793]: PR: request list timeout, retries left 0
[ INFO] [1407272124.546174904]: FCU: WPM: mission is empty
[ERROR] [1407272124.551688056]: FCU: REJ. WP CMD: partner id mismatch

Already checked Pixhawk params and they correspond:

MAV_COMP_ID 50
MAV_SYS_ID 1

@vooon
Copy link
Member Author

vooon commented Aug 5, 2014

What FW version? Todays master responds to WP correctly. With previous WP broken.

@TSC21
Copy link
Member

TSC21 commented Aug 5, 2014

This happens before I start GCS. Starting GCS in another cmd line, I get this in the mavros_node log:

[ INFO] [1407272897.757804339]: udp1: Remote address: 127.0.0.1:14550
[ INFO] [1407272897.763815641]: FCU: WPM: mission is empty
[ INFO] [1407272897.764819978]: WP: seems GCS requesting mission
[ INFO] [1407272897.797086568]: FCU: WPM: mission is empty
[ INFO] [1407272897.797230333]: WP: seems GCS requesting mission
[ INFO] [1407272897.818318580]: FCU: [pm] sending list

vooon added a commit that referenced this issue Aug 5, 2014
Also fix PX4 wrong ?ids usage (it set mavros ids, not target).
Issue #68.
@vooon
Copy link
Member Author

vooon commented Aug 5, 2014

I found, that i set wrong ids pair. Now param plugin works like a charm, but WP not.

@vooon
Copy link
Member Author

vooon commented Aug 5, 2014

Hmm, log indicates that WP io goes wright.

[DEBUG] [1407273850.462086460]: WP: start sheduled pull
[DEBUG] [1407273850.462259052]: WP:m: request list
[DEBUG] [1407273850.464571286]: WP: count 0
[DEBUG] [1407273850.464771105]: WP:m: ACK 0
[DEBUG] [1407273850.464880113]: WP: mission received
[ INFO] [1407273850.496108278]: FCU: WPM: mission is empty
[ERROR] [1407273850.546594200]: FCU: REJ. WP CMD: partner id mismatch

But i don't know why FCU send REJ message (maybe it rejects ACK?).

QGC sends WP's (i don't connect GPS, maybe error related):

[ INFO] [1407273879.631079551]: WP: seems GCS requesting mission
[ INFO] [1407273879.633313588]: FCU: WPM: mission is empty
[DEBUG] [1407273896.278800256]: WP: rejecting request, wrong state 0
[DEBUG] [1407273896.289550632]: WP: rejecting request, wrong state 0
[DEBUG] [1407273896.312426375]: WP: rejecting request, wrong state 0
[DEBUG] [1407273896.335601823]: WP: rejecting request, wrong state 0
[DEBUG] [1407273896.356802430]: WP: rejecting request, wrong state 0
[DEBUG] [1407273896.382305863]: WP: rejecting request, wrong state 0
[ INFO] [1407273896.405459026]: FCU: WPM: Transfer complete.
[DEBUG] [1407273896.410691654]: WP: not planned ACK, type: 0
[DEBUG] [1407273896.488031037]: WP: update current #0
[ERROR] [1407273898.527134013]: FCU: IGN MISSION_ITEM: No transfer
[ERROR] [1407273900.648186731]: FCU: IGN MISSION_ITEM: No transfer
[ERROR] [1407273902.616819974]: FCU: IGN MISSION_ITEM: No transfer
[ERROR] [1407273904.637854768]: FCU: IGN MISSION_ITEM: No transfer
[ERROR] [1407273906.656454148]: FCU: IGN MISSION_ITEM: No transfer

But the i request WP's in QGC:

[ INFO] [1407274106.876892801]: WP: seems GCS requesting mission
[DEBUG] [1407274106.881379615]: WP: rejecting item, wrong state 0
[DEBUG] [1407274106.902249445]: WP: rejecting item, wrong state 0
[DEBUG] [1407274106.924460401]: WP: rejecting item, wrong state 0
[DEBUG] [1407274106.947728231]: WP: rejecting item, wrong state 0
[DEBUG] [1407274106.971124948]: WP: rejecting item, wrong state 0
[DEBUG] [1407274106.991988736]: WP: rejecting item, wrong state 0

And it works in mavros:

$ rosrun mavros mavwp show -p
+---+------+------+---------+---------------+-----+-----+-----+-----+--------------------+-------------------+-------+
| # | Curr | Auto |  Frame  |    Command    |  P1 |  P2 |  P3 |  P4 |       X Lat        |       Y Long      | Z Alt |
+---+------+------+---------+---------------+-----+-----+-----+-----+--------------------+-------------------+-------+
| 0 | Yes  | Yes  | GRA (3) | WAYPOINT (16) | 0.0 | 0.0 | 0.0 | 0.0 |  0.0137329101562   | -0.00995635986328 | 500.0 |
| 1 |  No  | Yes  | GRA (3) | WAYPOINT (16) | 0.0 | 0.0 | 0.0 | 0.0 |  0.0171661376953   |  0.0178527832031  | 500.0 |
| 2 |  No  | Yes  | GRA (3) | WAYPOINT (16) | 0.0 | 0.0 | 0.0 | 0.0 | -0.000686645507812 |  0.0248908996582  | 500.0 |
| 3 |  No  | Yes  | GRA (3) | WAYPOINT (16) | 0.0 | 0.0 | 0.0 | 0.0 |  -0.0176811218262  |  0.0178527832031  | 500.0 |
| 4 |  No  | Yes  | GRA (3) | WAYPOINT (16) | 0.0 | 0.0 | 0.0 | 0.0 |  -0.018367767334   | -0.00600814819336 | 500.0 |
| 5 |  No  | Yes  | GRA (3) | WAYPOINT (16) | 0.0 | 0.0 | 0.0 | 0.0 | -0.00120162963867  |  -0.0169944763184 | 500.0 |
+---+------+------+---------+---------------+-----+-----+-----+-----+--------------------+-------------------+-------+

Log:

[DEBUG] [1407274231.696659129]: WP:m: request list
[DEBUG] [1407274231.698874347]: WP: count 6
[DEBUG] [1407274231.699098404]: WP:m: request #0
[ INFO] [1407274231.703422700]: WP: item #0 GRA WAYPOINT CUR params: 0, 0, 0, 0 x: 0.0137329 y: -0.00995636 z: 500
[DEBUG] [1407274231.703557734]: WP:m: request #1
[ INFO] [1407274231.706069656]: WP: item #1 GRA WAYPOINT     params: 0, 0, 0, 0 x: 0.0171661 y: 0.0178528 z: 500
[DEBUG] [1407274231.706228679]: WP:m: request #2
[ INFO] [1407274231.709044621]: WP: item #2 GRA WAYPOINT     params: 0, 0, 0, 0 x: -0.000686646 y: 0.0248909 z: 500
[DEBUG] [1407274231.709254568]: WP:m: request #3
[ INFO] [1407274231.712083156]: WP: item #3 GRA WAYPOINT     params: 0, 0, 0, 0 x: -0.0176811 y: 0.0178528 z: 500
[DEBUG] [1407274231.712207052]: WP:m: request #4
[ INFO] [1407274231.715413007]: WP: item #4 GRA WAYPOINT     params: 0, 0, 0, 0 x: -0.0183678 y: -0.00600815 z: 500
[DEBUG] [1407274231.715542306]: WP:m: request #5
[ INFO] [1407274231.718201693]: WP: item #5 GRA WAYPOINT     params: 0, 0, 0, 0 x: -0.00120163 y: -0.0169945 z: 500
[DEBUG] [1407274231.718298759]: WP:m: ACK 0
[DEBUG] [1407274231.718427446]: WP: mission received

So i decide, that waypoint also work, in despite of FCU messages.

@vooon
Copy link
Member Author

vooon commented Aug 5, 2014

Command plugin also works, when i try rosrun mavros mavsafety arm FCU blinks with red + beep error.

[ERROR] [1407274529.594681777]: FCU: ARM FAIL: ACCEL CALIBRATION
[ERROR] [1407274529.645138580]: FCU: REJECTING component arm cmd
[ERROR] [1407274529.695653018]: FCU: command temporarily rejected: 400

But mavsafety log error, because it want confirmation ACK from FCU (but PX4 don't send it).
rosservice call /mavros/cmd/command 400 0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 gives same result, but returns success.

@TSC21
Copy link
Member

TSC21 commented Aug 5, 2014

Don't you have to press the safety button first so you can arm it?

@TSC21
Copy link
Member

TSC21 commented Aug 5, 2014

I'm getting service [/mavros/cmd/arming] unavailableafter rosrun mavros mavsafety arm.

Update: Ok I had to remove 'command' from the blacklist.

I'm getting the same problem as you even though I pressed the safety button.

@vooon
Copy link
Member Author

vooon commented Aug 5, 2014

Check rosnode info mavros. Arming button don't change anything, i must calibrate sensors first :)

@TSC21
Copy link
Member

TSC21 commented Aug 5, 2014

I done it! It works @vooon. The problem was I didn't have the battery connected :D
So the steps are:

  1. Connect battery
  2. Press the safety button
  3. rosrun mavros mavsafety arm
  4. Happy flights! :D
  5. rosrun mavros mavsafety disarm
  6. Press safety button again

@TSC21
Copy link
Member

TSC21 commented Aug 5, 2014

What about takeoff and land commands? (They're related to auto mode)

vooon added a commit that referenced this issue Aug 5, 2014
@vooon
Copy link
Member Author

vooon commented Aug 5, 2014

You can try it via common CommandLong.

@TSC21
Copy link
Member

TSC21 commented Aug 5, 2014

How to? rosservice call /mavros/cmd/command ...? Can you create aliases to this kind of commands?

@vooon
Copy link
Member Author

vooon commented Aug 6, 2014

Look https://pixhawk.ethz.ch/mavlink/ MAV_CMD enum. 21/22 + yaw + latlonalt.
http://docs.ros.org/api/mavros/html/srv/CommandLong.html

@TSC21
Copy link
Member

TSC21 commented Aug 6, 2014

Ok so rosrun mavros mavsafety arm is an alias of rosservice call /mavros/cmd/command 400 0 1.0 0.0 0.0 0.0 0.0 0.0 0.0.
What I was asking is if it is possible to create an alias like: (considering a mavcmd script)

rosrun mavros mavcmd takeoff pitch=... yaw=... lat=... lon=... alt=...
rosrun mavros mavcmd land yaw=... lat=... lon=... alt=...

Probably the best option here is tell the fcu to land in the current lat/lon, given that we are not setting up a mission but yes controlling it's behaviour. That way we don't have to send those in the cmd.

vooon added a commit that referenced this issue Aug 6, 2014
This was referenced Aug 6, 2014
@vooon
Copy link
Member Author

vooon commented Aug 6, 2014

IMU starting send data right after calibration. But ATTITUDE_QUATERNION not tested (require custom rc script).

Next: implement decoding custom mode. Here i must decide style for strings, e.g. APM: "RTL", "LAND" etc, while PX4 use AUTO_RTL, AUTO_LAND...

@vooon
Copy link
Member Author

vooon commented Aug 6, 2014

Also default mavlink dialect enable APM specific diag, maybe need split ~sys/disable_diag.

@TSC21
Copy link
Member

TSC21 commented Aug 6, 2014

@vooon the mavlink dialect definition should be dinamic and depending on the firmware running on board read from mavros. Depending on the defines dialect, decoding of custome mode should give or a APM style or a PX4 string style.

@vooon
Copy link
Member Author

vooon commented Aug 7, 2014

@TSC21 It is not possible with current implementation of mavlink.

Current strings based on pymavlink utils, but it decode APM only.

@TSC21
Copy link
Member

TSC21 commented Aug 7, 2014

What's the default dialect in ros-*-mavlink pkg? Do we have to pymavlink\generator\mavgen.py to have pixhawk headers available also?

@vooon
Copy link
Member Author

vooon commented Aug 7, 2014

ros-*-mavlink contains all dialects. Selection done by MAVLINK_DIALECT cmake option.

catkin_make -DMAVLINK_DIALECT=pixhawk

But almost all works with common.xml.

@TSC21
Copy link
Member

TSC21 commented Aug 7, 2014

In /opt/ros/hydro/share/mavlink/src/v1.0, there's a pixhawk folder with pixhawk.pb.cc file. Does that mean my current dialect is set to be the Pixhawk one?

Anyway, I used the process of installing from the source and did catkin_make_isolated --install-space /opt/ros/hydro --install -DCMAKE_BUILD_TYPE=Release -DMAVLINK_DIALECT=pixhawk.

@vooon
Copy link
Member Author

vooon commented Aug 7, 2014

No, pixhawk.pb.cc is part of (seems outdated) pixhawk dialect (actually is protocol buffers).

Mavlink package have all dialects, but what to use defined by -DMAVLINK_DIALECT.

@TSC21
Copy link
Member

TSC21 commented Aug 7, 2014

Yes I already changed the dialect ;)
You should refere that in the mavros install notes.

@vooon
Copy link
Member Author

vooon commented Aug 7, 2014

I described in wiki...

@vooon
Copy link
Member Author

vooon commented Aug 7, 2014

... And now in readme.

@TSC21
Copy link
Member

TSC21 commented Aug 7, 2014

Great work! :D

@vooon
Copy link
Member Author

vooon commented Aug 8, 2014

GPS works, but PX4 don't send GPS time (#95).

@vooon
Copy link
Member Author

vooon commented Aug 8, 2014

Btw: ATTITUDE_QUATERNION works. But i has strange slow roll CCW over X, but ATTITUDE shows same.
Also try enable HIGHRES_IMU at 150 Hz, but get only 110.

@vooon
Copy link
Member Author

vooon commented Aug 8, 2014

All core plugins works. But still SYS_STATUS send 0 in sensor health/enabled/present bit fields.

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

No branches or pull requests

3 participants