Page 2 of 2

Re: data from SLAM(ROS)

Posted: Mon Nov 04, 2019 7:24 pm
by RyanMco
once I run the second script, the crazyflie just moving its motors and it's staying on the ground not hovering ..
ofcourse Im doing that while slam is working (getting data from slam)

Re: data from SLAM(ROS)

Posted: Tue Nov 05, 2019 4:14 pm
by RyanMco
Any help?! Im still stuck helpers !

Re: data from SLAM(ROS)

Posted: Wed Nov 06, 2019 9:00 am
by arnaud
My input would be to try to debug your system step by step: I already pointed-out the type of packet that is sent for sending external position to the Crazyflie, you could put a printf at that point to make sure the packet is indeed sent.

On the Crazyflie side you can look at the external position log variables to make sure the data makes it to the Crazyflie: https://github.com/bitcraze/crazyflie-f ... #L247-L251

Then, in the Crazyflie again, you should look at the estimated position before attempting any flight: https://github.com/bitcraze/crazyflie-f ... #L629-L632. If the position estimate does not make sense, autonomous flight will not work.

Re: data from SLAM(ROS)

Posted: Wed Nov 06, 2019 9:09 am
by RyanMco
Really appreciate your effort to answer.
but I have changed a lil in my scripts as I pointed before, is there a problem with them? maybe Im forgetting something in the code that I wrote itself?!
I have changed a lil in the code that you pointed before about sending external position .. maybe my new code is having a problem?

Re: data from SLAM(ROS)

Posted: Thu Nov 07, 2019 10:00 am
by arnaud
It is hard to debug such a script without the actual system.

You need to check that the position you are sending is indeed sent to the Crazyflie, this is the first step to debug your problem and I sent you pointers of how to do so earlier. This will allow you to locate where the problem is.

Re: data from SLAM(ROS)

Posted: Tue Nov 19, 2019 10:07 am
by RyanMco
but lets assume that I run this script python using data from ROS*SLAM*
import rospy
import crazyflie
import time
import uav_trajectory

if __name__ == '__main__':
rospy.init_node('test_high_level')

cf = crazyflie.Crazyflie("crazyflie3", "crazyflie3")

cf.setParam("commander/enHighLevel", 1)

cf.takeoff(targetHeight = 0.2, duration = 2.0)
time.sleep(5.0)
cf.goTo(goal = [0.5, 0.0, 0.0], yaw=0.2, duration = 2.0, relative = True)
time.sleep(5.0)
cf.land(targetHeight = 0.0, duration = 2.0)


where does this instruction "cf.goTo(goal = [0.5, 0.0, 0.0], yaw=0.2, duration = 2.0, relative = True)" sent to crazyflie? at which functions? I mean is it sent like ROS TF MESSAGE? it should be setpoint? could you please help me at which function in my firmware once I run that instruction could find the set point data 0.5 0.0 0.0


thanks !

Re: data from SLAM(ROS)

Posted: Tue Nov 19, 2019 10:46 am
by arnaud
See my answer in your other thread where I point the place in the code where the goto packet is received: viewtopic.php?f=6&t=3987&p=18179#p18179