Copter SITL Linux

I've setup SITL exactly as mentioned in the wiki. After running 

sim_vehicle.sh --console --map --aircraft test

I receive the message

MAV> Waiting for heartbeat from tcp:127.0.0.1:5760

I'm unable to do anything in the SITL because of this. Can anyone help me diagnose this issue?

Thanks!

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Hi everyone !

    I'm testing sitl arducopter and i'm got some questions about it :

    - Firstly, is this link still relevant ?

    - Is it possible to send c++ code, which use mavlink, directly to sitl or it's also possible to make sitl with GCS ?

    - If it's possible, is it possible to someone explain me how to make it ?

    Thanks you very much !

    Thomas

  • Yep, I first ran that to erase the EEPROM and then ran the sim_vehicle with the aircraft and map parameters. Even the first command(sim_vehicle.sh -w) complains about the heartbeat. (It creates the .o files and then does the parameters process and then says no heartbeat message)

    So far - both sim_vehicle.sh -w and the longer command complain about the heartbeat. I did a nmap on the localhost and that port has nothing on it(not open/active).
    • Developer
      When in ArduCopter directory, do git checkout Copter-3.3 and try again. The issue is that the ArduCopter.elf is not being built.
      • Hey Bill, I did the following

        sudo apt-get install realpath
        git checkout Copter-3.3

        git pull

        went into the ArduCopter directory and ran sim_vehicle.sh -w

        then I ran sim_vehicle.sh without the aircraft parameter.


        Here's the output


        Building /tmp/ArduCopter.build/ArduCopter.elf
        %% ArduCopter.elf
        Firmware is in ArduCopter.elf
        ~/ardupilot/ArduCopter
        Starting up at CMAC : -35.363261,149.165230,584,353
        Starting ardupilot : /home/pi/ardupilot/ArduCopter/ArduCopter.elf -S -I0 --home -35.363261,149.165230,584,353 --model + --speedup=1
        Window access not found, logging to /tmp/ardupilot.log
        Connect tcp:127.0.0.1:5760 source_system=255
        Unable to access the X Display, is $DISPLAY set properly?
        Loaded module console
        Loaded module map
        no script test/mavinit.scr
        Log Directory: test/logs/2015-11-17/flight1
        Telemetry log: test/logs/2015-11-17/flight1/flight.tlog
        MAV> Waiting for heartbeat from tcp:127.0.0.1:5760
        • Developer

          Ok, how are you logging in to run SITL, It look like you don't have X setup.

          If you are logging in remotely you can do two things

          1) Run without Console/Map. Start screen session when you ssh in and then use sim_vehilce.sh

          2) use ssh -Y when you connect e.g ssh -Y 10.0.1.26 and this sets XDISPLAY to be your connectinh host. It will then show the console and the map 

          If you are on the same machine and without X installed. you can do the same as step 2, run screen, then run sim_vehicle.sh from the ArduCopter directory. CTRL A,0 will switch you back to the MAVProxy command view. CTRL-A D detahces the screen and leaves it running. screen -r resumes the screen session. CTRL-C in the MACProxy command view quits

          • I'm currently using option 1 of your suggestions.

            Building sitl// BUILDROOT=/tmp/ArduCopter.build HAL_BOARD=HAL_BOARD_SITL HAL_BOARD_SUBTYPE=HAL_BOARD_SUBTYPE_NONE TOOLCHAIN=NATIVE EXTRAFLAGS=-DGIT_VERSION="802ced20"~/ardupilot/ArduCopter
            Starting up at CMAC : -35.363261,149.165230,584,353
            Starting ardupilot : /home/ubuntu/ardupilot/ArduCopter/ArduCopter.elf -S -I0 --home -35.363261,149.165230,584,353 -w --model + --speedup=1
            Window access not found, logging to /tmp/ardupilot.log
            Connect tcp:127.0.0.1:5760 source_system=255
            (error(111, 'Connection refused'), 'sleeping')
            (error(111, 'Connection refused'), 'sleeping')
            Failed to connect to tcp:127.0.0.1:5760 : [Errno 111] Connection refused
        • Developer
          Same issue. You probably don't have all the dependencies installed for the firmware to build. You should be able to type make sitl in the ArduCopter folder and see it build. See dev.ardupilot.com for instructions on building.
          • Figured out the error. when I type make sitl, I get a bunch of errors after

            Building /tmp/ArduCopter.build/ArduCopter.elf%% ArduCopter.elf

            These errors are

            /tmp/ArduCopter.build/ArduCopter.o: In function `Copter::dataflash_periodic()':/home/ubuntu/zipquad/ardupilot/ArduCopter/ArduCopter.cpp:438: undefined reference to `DataFlash_Class::perio


            all these errors vanished when I did make clean and then make sitl

            but when it sets the params it gets timeouts

            Connect tcp:127.0.0.1:5760 source_system=255set FRAME to 0.000000timeout setting FRAME to 0.000000
            set MAG_ENABLE to 1.000000
            timeout setting MAG_ENABLE to 1.000000
            set FS_THR_ENABLE to 1.000000
            timeout setting FS_THR_ENABLE to 1.000000
          • I followed the tutorial and ran the 

            ardupilot/Tools/scripts/install-prereqs-ubuntu.sh -y

            and then did

            make sitl

            and it returned.

            // BUILDROOT=/tmp/ArduCopter.build HAL_BOARD=HAL_BOARD_SITL HAL_BOARD_SUBTYPE=HAL_BOARD_SUBTYPE_NONE TOOLCHAIN=NATIVE EXTRAFLAGS=-DGIT_VERSION="802ced20"

            I then tried

            make px4-v2 
            It put in several lines and completed

  • Developer
    Did you do sim_vehicle.sh -w first to initialize the Params?
This reply was deleted.

Activity

Neville Rodrigues liked Neville Rodrigues's profile
Jun 30
Santiago Perez liked Santiago Perez's profile
Jun 21
More…