jtanx / picopterx

FYP 2015 Hexacopter project 🚁🚁🚁🚁
2 stars 1 forks source link

Observations #114

Closed jtanx closed 8 years ago

jtanx commented 8 years ago
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffdc7c9700 (LWP 3638)]
0x0000000000553cbe in picopter::Observations::lastObservation (this=0x0)
    at /home/jeremy/fyp/picopterx/code/src/modules/observations.cpp:75
75      return accumulator.sample_time;
(gdb) p accumulator.sample_time
Cannot access memory at address 0x0
(gdb) bt
#0  0x0000000000553cbe in picopter::Observations::lastObservation (this=0x0)
    at /home/jeremy/fyp/picopterx/code/src/modules/observations.cpp:75
#1  0x000000000054d6f2 in picopter::ObjectTracker::Run (this=0xfc3e18, 
    fc=0x10322c0, opts=0x0)
    at /home/jeremy/fyp/picopterx/code/src/modules/object_tracker.cpp:270
#2  0x0000000000524c71 in picopter::FlightController::__lambda4::operator() (
    __closure=0xfcebe0)
    at /home/jeremy/fyp/picopterx/code/src/base/flightcontroller.cpp:312
#3  0x0000000000527208 in std::_Bind_simple<picopter::FlightController::RunTask(picopter::TaskIdentifier, std::shared_ptr<picopter::FlightTask>, void*)::__lambda4()>::_M_invoke<>(std::_Index_tuple<>) (this=0xfcebe0)
    at /usr/include/c++/4.8/functional:1732
#4  0x0000000000527007 in std::_Bind_simple<picopter::FlightController::RunTask(picopter::TaskIdentifier, std::shared_ptr<picopter::FlightTask>, void*)::__lambda4()>::operator()(void) (this=0xfcebe0) at /usr/include/c++/4.8/functional:1720
#5  0x0000000000526d46 in std::_Function_handler<void(), std::reference_wrapper<std::_Bind_simple<picopter::FlightController::RunTask(picopter::TaskIdentifier, std::shared_ptr<picopter::FlightTask>, void*)::__lambda4()> > >::_M_invoke(const std::_Any_data &) (__functor=...) at /usr/include/c++/4.8/functional:2101
#6  0x000000000052c68e in std::function<void ()>::operator()() const (
    this=0xfadcf8) at /usr/include/c++/4.8/functional:2471
#7  0x000000000052c4d8 in std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, void>

snip
jtanx commented 8 years ago

@BrettRD you can add the following in the Run function (around line 153; just after we've checked that we got authorisation):

    //Get the launch position.
    if (!fc->fb->GetHomePosition(&launch_point)) {
        Log(LOG_WARNING, "I don't know the launch position! Bailing!!!");
        return;
    }
jtanx commented 8 years ago

From my brief testing in the simulator it still looks like the copter will go flying off into the horizon (at 5m/s) with the current gains. The tracking arrow shouldn't be near 100% (extends from the centre to the edge of the frame) when the object is close to centre.