mohamedsayed18 / Drone_simulation

Drone simulation using ROS, Gazebo and PX4
MIT License
25 stars 7 forks source link

ALVAR library with Noetic #5

Open mnaeemmsee20seecs opened 2 weeks ago

mnaeemmsee20seecs commented 2 weeks ago

Hi Mohamed, thank you for this repository. I am using ROS noetic and unfortunately this ALVAR library seem to does not exist for this distro. What do you suggest I should do to get this to work for me? Have you tried any other library or any work around to get ALVAR to work for noetic?

mohamedsayed18 commented 2 weeks ago

Hi, I think you could try to install the git repo of the ALVAR and compile it in your workspace as a ROS package

mnaeemmsee20seecs commented 2 weeks ago

Thank you for the quick response. I have tried that. But still it is not working for me.

mnaeemmsee20seecs commented 2 weeks ago

When I run arming.py that library is not being recognized

mohamedsayed18 commented 2 weeks ago

I think I built it using noetic and this what you could, look for how to build a ros package(ALVAR) from source and then it should work fine.

you could also look if there is a backport for this package to noetic

mnaeemmsee20seecs commented 1 week ago

I don't get any error when I "catkin build" this package but somehow I am unable to get the arming.py to work and get this error

from ar_track_alvar_msgs.msgs import AlvarMarkers
ModuleNotFoundError: No module named 'ar_track_alvar_msgs.msgs'
mnaeemmsee20seecs commented 1 week ago

Hi Mohammed, I got it to work. Now my problem has shifted to a new one though. The drone is arming, taking off and everything but it is not landing now.

I have a following error now [ INFO] [1715149637.112694864, 1.680000000]: CON: Got HEARTBEAT, connected. FCU: PX4 Autopilot [ INFO] [1715149637.117686747, 1.688000000]: IMU: High resolution IMU detected! [ INFO] [1715149637.322847063, 1.884000000]: IMU: Attitude quaternion IMU detected! [ INFO] [1715149638.127289650, 2.556000000]: GF: Using MISSION_ITEM_INT [ INFO] [1715149638.127384634, 2.556000000]: RP: Using MISSION_ITEM_INT [ INFO] [1715149638.127448787, 2.556000000]: WP: Using MISSION_ITEM_INT [ INFO] [1715149638.127543521, 2.556000000]: VER: 1.1: Capabilities 0x000000000000e8ff [ INFO] [1715149638.127644470, 2.556000000]: VER: 1.1: Flight software: 010f0000 (c7725d74b4000000) [ INFO] [1715149638.127707093, 2.556000000]: VER: 1.1: Middleware software: 010f0000 (c7725d74b4000000) [ INFO] [1715149638.127767681, 2.556000000]: VER: 1.1: OS software: 050f00ff (cc880bbecd215f55) [ INFO] [1715149638.127824435, 2.556000000]: VER: 1.1: Board hardware: 00000001 [ INFO] [1715149638.127919612, 2.556000000]: VER: 1.1: VID/PID: 0000:0000 [ INFO] [1715149638.127977322, 2.556000000]: VER: 1.1: UID: 4954414c44494e4f INFO [commander] Ready for takeoff! [ INFO] [1715149653.768968373, 16.680000000]: GF: mission received [ INFO] [1715149653.773173997, 16.684000000]: RP: mission received [ INFO] [1715149653.773485758, 16.684000000]: WP: mission received [ERROR] [1715149686.577260770, 44.404000000]: TM : Time jump detected. Resetting time synchroniser. WARN [health_and_arming_checks] Preflight Fail: height estimate not stable [ERROR] [1715149737.371853192, 87.984000000]: TM : Time jump detected. Resetting time synchroniser. [ERROR] [1715149788.172114611, 130.392000000]: TM : Time jump detected. Resetting time synchroniser. pxh> INFO [commander] Armed by external command INFO [tone_alarm] arming warning [ WARN] [1715149836.512831429, 172.508000000]: CMD: Unexpected command 176, result 0 INFO [commander] Takeoff detected [ERROR] [1715149839.263849368, 174.820000000]: TM : Time jump detected. Resetting time synchroniser. [ERROR] [1715149890.664207152, 217.636000000]: TM : Time jump detected. Resetting time synchroniser. [ERROR] [1715149942.265000551, 258.068000000]: TM : Time jump detected. Resetting time synchroniser. [ERROR] [1715149994.264072157, 302.544000000]: TM : Time jump detected. Resetting time synchroniser. [ERROR] [1715150045.665081779, 346.100000000]: TM : Time jump detected. Resetting time synchroniser. [ERROR] [1715150097.963681813, 389.620000000]: TM : Time jump detected. Resetting time synchroniser. [ERROR] [1715150149.466487259, 433.676000000]: TM : Time jump detected. Resetting time synchroniser. [ERROR] [1715150200.864366893, 473.512000000]: TM : Time jump detected. Resetting time synchroniser. [ERROR] [1715150251.964232472, 514.576000000]: TM : Time jump detected. Resetting time synchroniser.

Screenshot from 2024-05-08 11-36-04

I have included the following line in AR_detect.launch <param name="use_sim_time" value="true"/> but it did not solve the problem.

mohamedsayed18 commented 1 week ago

Good work, At the moment I can't reproduce your error on my PC. but I'm sure you will be able to figure it out.

Could you open a PR with any new changes that will make it work for you

mnaeemmsee20seecs commented 3 days ago

Everything worked; the logic I was using was all fine but there was this silly mistake; the image topic from iris was /iris/usb_cam/image_raw while in the launch file it was /iris/cam1/image_raw. The only problem now though is that the drone lands quite off the target; I tried calibrating the camera but results were even shocking. But still trying.

Secondly there is a quite a lot delay in the gazebo window while the terminals show the landing successful message very earlier.