-
Notifications
You must be signed in to change notification settings - Fork 207
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
Intel Aero RTF HITL -SYS_HITL mode jMavSim - WARN [commander] rejecting takeoff, no position lock yet. #74
Comments
Hi
|
Hi @bkueng. Thanks for hints. I went trough whole process again.
4.Connected JMavlink trough FTDI cable to connector mentioned in point 2 by command ./jmavsim_run.sh /dev/ttyUSB0 57600
nsh> commander status Any suggestions please? I do not know how exactly HITL simulates the GPS? Running fake gps from nsh also does not help. QGround obviously reports that it has enough satellites, 3dfix but commander takeoff result is the same - rejecting takeoff, no position lock yet. Thank you. |
The FTDI is probably too slow to run HIL, I suggest to try via USB. |
Hi @bkueng I tried commands above. There is no activity for sensor_combined topic,vehical_gps_positions. System is showing 0 for all variables. I want to be sure. Am I really connected with jMavSim to AeroFC flight controller? 1.Can you please advice me where in the code of jMavSim I can verify, that I do have got connectivity to AeroFC? or 2.Or verify, that PX4 on Intel Board - AeroFC is listening on po 14560 via nsh Nuttx? or 3./jmavsim_run.sh 192.168.7.2:14560 should connect me to AeroFC PX4 trough UDP (USB connector on AeroBoard). Correct?But I never get following message after JMavSim is started: Init MAVLink But for instance I have no issues running ./mavlink_shell.py 0.0.0.0:14550 connection to AeroFc Nuttx shell. |
@bkueng I am also adding following system output: ** My config of jmavsim_run.sh is:** #! /bin/bash SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" udp_port=14560 ss -au command shows: State Recv-Q Send-Q Local Address:Port Peer Address:Port ESTAB is jMavsim connection. Is it correct? 192.168.7.2 is address of Intel RTF Aero Board. mavlink- router is running there ( I enabled port 14560 in the mavlink-router) |
So the GPS messages don't arrive at the flight controller. This can be a port/connectivity issue or some issue in mavlink router (not forwarding these messages for some reason). To further test, you can do:
The HIL mavlink connection is created here: https://github.com/PX4/jMAVSim/blob/master/src/me/drton/jmavsim/Simulator.java#L175 |
@bkueng mavlink_shell.py 0.0.0.0:14560 works (or IP that has been assigned to by AeroBoard to my Ubuntu USB device works as well). Unfortunately command you recommended does not work. But I did following steps - befor jMavsimSim throws exception some mavlink data are send to AeroFC. Please take a look below:
[General] [UartEndpoint uart] [UdpEndpoint wifi] [UdpEndpoint ethernet-over-usb] [UdpEndpoint csd]
udp 0 0 *:50506 : 341/mavlink-routerd 4. When I try run ./jmavsim_run.sh -q -i 192.168.7.2 -p 41355 -r 250 (on 41355 port or other 2 ports) a)jMavsim writes Init MAVLink. Than it throws exception: BUILD SUCCESSFUL Init MAVLink a) NuttX PX4 nsh shell writes: ERROR [sensors] Mag #0 fail: TIMEOUT! b) In nsh shell I run listener sensor_combined.....I can see that some data has been sent before Mavsim crashed nsh> listener sensor_combined TOPIC: sensor_combined instance 0 #1 Can you please suggest if this is wrong configuration of mavlink-router or is this related to jMavSim? |
My mistake, you're right, it should be
instead, since at this point we already read the msg ID & extension bytes. |
@bkueng @julianoes I made the fix in the source code as recommended. Helped but not copletely. Please read below.
4. But Model in the JMavsim is not moving at all, no matter if I take-off from QGC or TakeOff via RC....but mavlink messages are reported I have notice few reports from NSH Boot console: a) ERROR[sensors] FAILED APPLYING mag CAL 0 Should I set different values for eph and epv values in MAVLINK message. Can you suggest where?Probably SimpleSensors sensors = new SimpleSensors(); and than sensors.SomeFunction all this in Simulator.java function buildMulticopter? Or the reason why model is not moving is different? Thanks for advices. |
Good, we're making progress :) Next you need to check if the simulator receives the The VDOP & HDOP being 0 is not a problem. |
@bkueng yes we have some progress :-).I will send PR for jMAVSim fix.
Number d = ((Number)((Object[])msg.get("controls"))[i]).doubleValue();
HIL_ACTUATOR_CONTROLS = trueHIL_ACTUATOR_CONTROLS = trueHIL_ACTUATOR_CONTROLS = trueHIL_ACTUATOR_CONTROLS = trueHIL_ACTUATOR_CONTROLS = trueHIL_ACTUATOR_CONTROLS = trueHIL_ACTUATOR_CONTROLS = true 0.1900000125169754 4.uorb top tap_esc shows update: 1s, num topics: 77 5.uorb top pwm_out_sim update: 1s, num topics: 77 Seems it is not running.
update: 1s, num topics: 78 Seems almost all messages are lost?
timestamp: 129270006 1190 is propably puls length right? In this case each one for 1 motor. To give motor more power value should be rather higher than only 1190? |
No, these are separate commands: use
Correct. The range is from 1000 to 2000 and will be rescaled to [0, 1] for HIL_ACTUATOR_CONTROLS. After takeoff the values should go up to ~0.5, 0.19 is probably not enough to move the vehicle. Can you test with a joystick and give full throttle? (there's a virtual joystick in QGC) |
Where have we already read them? |
https://github.com/PX4/jMAVlib/blob/master/src/me/drton/jmavlib/mavlink/MAVLinkMessage.java#L111 |
@bkueng after using top command. I see tap_esc is running.So I did
0.1900000125169754 |
@bkueng you're right, I wonder why I added that. |
@bkueng Ok. Great. It works
|
Cool.
Can you make a PR for that? And modify 4070_aerofc like this:
Yes please.
This needs a bigger discussion and thus a new issue would be better, yes (I suggest in Firmware). I don't understand how you want to integrate that? If you have a real position that is not moving, and your simulated vehicle moves, how do you want to use the real position? |
@bkueng I made PR for both. In one case. In this case http://ci.px4.io:8080/blue/organizations/jenkins/Firmware/detail/PR-9132/1/pipeline there are some problems.
:-) yes that is correct. Basically I was just thinking to test that hedgehog is providing continuously accurate position.In position mode MAV should keep the position, in this case by using "indoor GPS". If hedgehog will provide some sudden inaccurate GPS coordinates(while HH is not moving) vehicle will start to drift? That was the main purpose. Should I create new Issue for setting up correct model/frame Aero RTF physical variables here in jMAVSim rep? I may need some suggestions to set it correctly, also add PX4Flow sensor, surfaces for sensor and suggestions how to add simulation of other sensors (Garmin v3 lite, switch off barometer etc. if possible). Or Gazebo is better for that kind of modifications? Anyway thanks a lot for guidance. |
If you want to add flow and other sensors then I suggest you use gazebo. It also has HIL support. |
Ok.Thanks a lot. I think we can close this issue. |
Hello. I am about to run HITL (Hardware In The Loop simulation). I am about to use jMavSim. But it seems, that QGround Control and jMavsim are not talking to each other. Or JMAVSim is not sending position lock info to Aero FC. Below are the steps I have done recently
1.Trough Nuttx Shell I set param set SYS_HITL 1 and SYS_AUTOSTART to 1001
2.But after reboot SYS_AUTOSTART keeps changing to 4070 (Aero RTF Frame) as I can see from Nuttx SyS console during boot + SYS_AUTOSTART: curr: 1001 -> new: 4070
4.Than I run QGround connected trough UDP - default configuration. Port 14550
I can arm and disarm trough QGC. But no MAV messages are visible in JMAVSim terminal. When I try take off in QGC. Nuttx console writes WARN [commander] rejecting takeoff, no position lock yet.
When I try the same by running commander takeoff in Nuttx console. Result is the same WARN [commander] rejecting takeoff, no position lock yet.
I guess WARN [commander] rejecting takeoff, no position lock yet. Please retry.. is because JMavsim is not sending message to Aero FC.....because SYS_AUTOSTART can not be set permanently to 1001?And also when I run gps status on NSH console. lat,lon values are not provided from jMAVSIM
INFO [gps] Main GPS
INFO [gps] protocol: UBX
INFO [gps] port: /dev/ttyS5, baudrate: 38400, status: OK
INFO [gps] sat info: disabled, noise: 95, jamming detected: NO
INFO [gps] position lock: 0, satellites: 0, last update: 78.8240ms ago
INFO [gps] lat: 0, lon: 0, alt: -17000
INFO [gps] vel: 0.00m/s, 0.00m/s, 0.00m/s
INFO [gps] hdop: 99.99, vdop: 99.99
INFO [gps] eph: 4294967.50m, epv: 3750725.00m
INFO [gps] rate position: 0.00 Hz
INFO [gps] rate velocity: 0.00 Hz
INFO [gps] rate publication: 0.00 Hz
INFO [gps] rate RTCM injection: 0.00 Hz
Any suggestions please?
The text was updated successfully, but these errors were encountered: