HKPolyU-UAV / E2ES

A complete MAV simulation on Gazebo
GNU General Public License v3.0
105 stars 32 forks source link

UAV not responding to keyboard controls #6

Open shubham-shahh opened 3 years ago

shubham-shahh commented 3 years ago

Hi, when I run the keyboard node there are no errors and the props start spinning in gazebo simulation, but when I use "1" it doesn't take off, nor do other commands work. there are no error messages as well. @Boyang--Li @Ttoto

Ttoto commented 3 years ago

Can you see the "takeoff" in your terminal? If so, Would you please have a check of the MAVROS messages (Topic name: /mavros/setpoint_position/local)?

shubham-shahh commented 3 years ago

Hi, when I launch the keyboard node, the output in the terminal is

horizon speed: 1 vertical speed: 0.5 turning speed: 0.3 Waiting for FCU connection Waiting for FCU connection Waiting for FCU connection change last_request Arm [ INFO] [1630657377.126451037, 623.426000000]: Offboard enabled [ INFO] [1630657378.233345001, 624.488000000]: Vehicle armed [ INFO] [1630657389.153295389, 634.796000000]: Vehicle armed [ INFO] [1630657401.109264202, 645.788000000]: Vehicle armed once I press "1" for takeoff the output is

[ INFO] [1630657521.482204445, 755.784000000]: Vehicle armed [ INFO] [1630657534.045969938, 766.788000000]: Vehicle armed 1kb_takeoff0,0,0.0178515 0,0,0.0178515 0,0,0.0274854 0,0,0.0367489 0,0,0.0460123 0,0,0.0550904 0,0,0.0645391 0,0,0.0736173 0,0,0.0828807 0,0,0.0921442 0,0,0.101408 0,0,0.110671 0,0,0.119934 0,0,0.129383 0,0,0.138461 0,0,0.147725 0,0,0.156988 0,0,0.166252 0,0,0.175515 0,0,0.184778 0,0,0.194042 0,0,0.203305 0,0,0.212569 0,0,0.221832 0,0,0.231281 0,0,0.240359 0,0,0.249808 .... 0,0,0.888984 0,0,0.898062 0,0,0.907511 0,0,0.916775 [ INFO] [1630657546.057812824, 777.780000000]: Vehicle armed [ INFO] [1630657557.810724562, 788.784000000]: Vehicle armed

The output on "./sim.sh" terminal is

[ INFO] [1630657674.978335246, 896.680000000]: HP: requesting home position INFO [commander] Disarmed by auto preflight disarming INFO [commander] Armed by external command INFO [logger] Start file log (type: full) INFO [logger] [logger] ./log/2021-09-03/08_27_57.ulg INFO [logger] closed logfile, bytes written: 601742 INFO [logger] Opened full log file: ./log/2021-09-03/08_27_57.ulg

the output for rostopic echo /mavros/setpoint_position/local is header: seq: 6640 stamp: secs: 0 nsecs: 0 frame_id: '' pose: position: x: 0.0 y: 0.0 z: 0.9167745490623592 orientation: x: 0.0 y: 0.0 z: -0.00043611827088959134 w: 0.9999999049004223

I am using ROS Noetic @Ttoto

before starting the keyboard node, the "./sim.sh" terminal outputs

[ INFO] [1630658478.563872730, 646.335000000]: HP: requesting home position [ INFO] [1630658489.439389871, 656.335000000]: HP: requesting home position [ INFO] [1630658500.196133568, 666.335000000]: HP: requesting home position [ INFO] [1630658510.969207715, 676.335000000]: HP: requesting home position [ INFO] [1630658522.163586182, 686.335000000]: HP: requesting home position [ INFO] [1630658533.184919660, 696.335000000]: HP: requesting home position [ INFO] [1630658543.483425469, 706.335000000]: HP: requesting home position [ INFO] [1630658554.168090434, 716.335000000]: HP: requesting home position [ INFO] [1630658564.738785995, 726.335000000]: HP: requesting home position

Ttoto commented 3 years ago

It seemed everything is workout fine. Would u please have a check of ur PX4's version?

shubham-shahh commented 3 years ago

It seemed everything is workout fine. Would u please have a check of ur PX4's version?

It is the same, as mentioned in the Repo instructions, I think the UAV is not able to localize hence it is constantly asking for Home position, there must be some problem with GPS, any fix for that?

Ttoto commented 3 years ago

So what u mean is that the position information(FLVIS or GPS) is not fixed and the vehicle is unable to arm and take-off?

chenhanpolyu commented 3 years ago

Hi, when I launch the keyboard node, the output in the terminal is

horizon speed: 1 vertical speed: 0.5 turning speed: 0.3 Waiting for FCU connection Waiting for FCU connection Waiting for FCU connection change last_request Arm [ INFO] [1630657377.126451037, 623.426000000]: Offboard enabled [ INFO] [1630657378.233345001, 624.488000000]: Vehicle armed [ INFO] [1630657389.153295389, 634.796000000]: Vehicle armed [ INFO] [1630657401.109264202, 645.788000000]: Vehicle armed once I press "1" for takeoff the output is

[ INFO] [1630657521.482204445, 755.784000000]: Vehicle armed [ INFO] [1630657534.045969938, 766.788000000]: Vehicle armed 1kb_takeoff0,0,0.0178515 0,0,0.0178515 0,0,0.0274854 0,0,0.0367489 0,0,0.0460123 0,0,0.0550904 0,0,0.0645391 0,0,0.0736173 0,0,0.0828807 0,0,0.0921442 0,0,0.101408 0,0,0.110671 0,0,0.119934 0,0,0.129383 0,0,0.138461 0,0,0.147725 0,0,0.156988 0,0,0.166252 0,0,0.175515 0,0,0.184778 0,0,0.194042 0,0,0.203305 0,0,0.212569 0,0,0.221832 0,0,0.231281 0,0,0.240359 0,0,0.249808 .... 0,0,0.888984 0,0,0.898062 0,0,0.907511 0,0,0.916775 [ INFO] [1630657546.057812824, 777.780000000]: Vehicle armed [ INFO] [1630657557.810724562, 788.784000000]: Vehicle armed

The output on "./sim.sh" terminal is

[ INFO] [1630657674.978335246, 896.680000000]: HP: requesting home position INFO [commander] Disarmed by auto preflight disarming INFO [commander] Armed by external command INFO [logger] Start file log (type: full) INFO [logger] [logger] ./log/2021-09-03/08_27_57.ulg INFO [logger] closed logfile, bytes written: 601742 INFO [logger] Opened full log file: ./log/2021-09-03/08_27_57.ulg

the output for rostopic echo /mavros/setpoint_position/local is header: seq: 6640 stamp: secs: 0 nsecs: 0 frame_id: '' pose: position: x: 0.0 y: 0.0 z: 0.9167745490623592 orientation: x: 0.0 y: 0.0 z: -0.00043611827088959134 w: 0.9999999049004223

I am using ROS Noetic @Ttoto

before starting the keyboard node, the "./sim.sh" terminal outputs

[ INFO] [1630658478.563872730, 646.335000000]: HP: requesting home position [ INFO] [1630658489.439389871, 656.335000000]: HP: requesting home position [ INFO] [1630658500.196133568, 666.335000000]: HP: requesting home position [ INFO] [1630658510.969207715, 676.335000000]: HP: requesting home position [ INFO] [1630658522.163586182, 686.335000000]: HP: requesting home position [ INFO] [1630658533.184919660, 696.335000000]: HP: requesting home position [ INFO] [1630658543.483425469, 706.335000000]: HP: requesting home position [ INFO] [1630658554.168090434, 716.335000000]: HP: requesting home position [ INFO] [1630658564.738785995, 726.335000000]: HP: requesting home position

I think the position output for x and y should not be 0. It may be caused by you are not correctly using the positioning message from GPS or the FLVIS (VIO). You can check the configuration of the PX4 parameters via QGroundController or other Apps. Also, you can try to put this package into a NEW workspace to eliminate any interference.