How to hide DroneKit-Python API messages











up vote
0
down vote

favorite












Displayed DroneKit message



Quick question. There is any way to hide or suppress messages from DroneKit-Python API (marked in red line)?



As a reference, below are the code I use.



#!/usr/bin/env python2
# -*- coding: utf-8 -*-

# setting up modules used in the program
from __future__ import print_function
from dronekit import connect
import exceptions
import socket
import time
import os

# connect to Rover
os.system("clear")
vehicle = connect('/dev/ttyS0', heartbeat_timeout = 30, baud = 57600)
time.sleep(2)

# instruction
print("nPress [Ctrl] + [c] to quit.nn")
# 3 sec delay
time.sleep(3)

# measure distance
while True:

# reading from rangefinder
rangefinder_distance = vehicle.rangefinder.distance
# print out the reading from rangefinder
print ("Rangefinder Distance: %.2f [m]" % float(rangefinder_distance))
# 1 sec delay
time.sleep(1)


Another example of DroneKit messages I want to hide.
Example 1Example 2










share|improve this question
























  • Can you more specify or give the sample of message you want to hide ?
    – Agustinus Baskara
    Nov 7 at 21:00










  • @AgustinusBaskara I added another sample images on the main question.
    – ヲヲヲ
    Nov 8 at 4:13















up vote
0
down vote

favorite












Displayed DroneKit message



Quick question. There is any way to hide or suppress messages from DroneKit-Python API (marked in red line)?



As a reference, below are the code I use.



#!/usr/bin/env python2
# -*- coding: utf-8 -*-

# setting up modules used in the program
from __future__ import print_function
from dronekit import connect
import exceptions
import socket
import time
import os

# connect to Rover
os.system("clear")
vehicle = connect('/dev/ttyS0', heartbeat_timeout = 30, baud = 57600)
time.sleep(2)

# instruction
print("nPress [Ctrl] + [c] to quit.nn")
# 3 sec delay
time.sleep(3)

# measure distance
while True:

# reading from rangefinder
rangefinder_distance = vehicle.rangefinder.distance
# print out the reading from rangefinder
print ("Rangefinder Distance: %.2f [m]" % float(rangefinder_distance))
# 1 sec delay
time.sleep(1)


Another example of DroneKit messages I want to hide.
Example 1Example 2










share|improve this question
























  • Can you more specify or give the sample of message you want to hide ?
    – Agustinus Baskara
    Nov 7 at 21:00










  • @AgustinusBaskara I added another sample images on the main question.
    – ヲヲヲ
    Nov 8 at 4:13













up vote
0
down vote

favorite









up vote
0
down vote

favorite











Displayed DroneKit message



Quick question. There is any way to hide or suppress messages from DroneKit-Python API (marked in red line)?



As a reference, below are the code I use.



#!/usr/bin/env python2
# -*- coding: utf-8 -*-

# setting up modules used in the program
from __future__ import print_function
from dronekit import connect
import exceptions
import socket
import time
import os

# connect to Rover
os.system("clear")
vehicle = connect('/dev/ttyS0', heartbeat_timeout = 30, baud = 57600)
time.sleep(2)

# instruction
print("nPress [Ctrl] + [c] to quit.nn")
# 3 sec delay
time.sleep(3)

# measure distance
while True:

# reading from rangefinder
rangefinder_distance = vehicle.rangefinder.distance
# print out the reading from rangefinder
print ("Rangefinder Distance: %.2f [m]" % float(rangefinder_distance))
# 1 sec delay
time.sleep(1)


Another example of DroneKit messages I want to hide.
Example 1Example 2










share|improve this question















Displayed DroneKit message



Quick question. There is any way to hide or suppress messages from DroneKit-Python API (marked in red line)?



As a reference, below are the code I use.



#!/usr/bin/env python2
# -*- coding: utf-8 -*-

# setting up modules used in the program
from __future__ import print_function
from dronekit import connect
import exceptions
import socket
import time
import os

# connect to Rover
os.system("clear")
vehicle = connect('/dev/ttyS0', heartbeat_timeout = 30, baud = 57600)
time.sleep(2)

# instruction
print("nPress [Ctrl] + [c] to quit.nn")
# 3 sec delay
time.sleep(3)

# measure distance
while True:

# reading from rangefinder
rangefinder_distance = vehicle.rangefinder.distance
# print out the reading from rangefinder
print ("Rangefinder Distance: %.2f [m]" % float(rangefinder_distance))
# 1 sec delay
time.sleep(1)


Another example of DroneKit messages I want to hide.
Example 1Example 2







dronekit-python dronekit






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 8 at 4:12

























asked Nov 7 at 15:37









ヲヲヲ

417




417












  • Can you more specify or give the sample of message you want to hide ?
    – Agustinus Baskara
    Nov 7 at 21:00










  • @AgustinusBaskara I added another sample images on the main question.
    – ヲヲヲ
    Nov 8 at 4:13


















  • Can you more specify or give the sample of message you want to hide ?
    – Agustinus Baskara
    Nov 7 at 21:00










  • @AgustinusBaskara I added another sample images on the main question.
    – ヲヲヲ
    Nov 8 at 4:13
















Can you more specify or give the sample of message you want to hide ?
– Agustinus Baskara
Nov 7 at 21:00




Can you more specify or give the sample of message you want to hide ?
– Agustinus Baskara
Nov 7 at 21:00












@AgustinusBaskara I added another sample images on the main question.
– ヲヲヲ
Nov 8 at 4:13




@AgustinusBaskara I added another sample images on the main question.
– ヲヲヲ
Nov 8 at 4:13












1 Answer
1






active

oldest

votes

















up vote
1
down vote



accepted










Just create a dummy printing function that do nothing.



def dummy_printer(x):
pass


Then pass it to the status_printer argument.



vehicle = connect('/dev/ttyS0', heartbeat_timeout = 30, baud = 57600, status_printer = dummy_printer)





share|improve this answer





















    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














     

    draft saved


    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53192723%2fhow-to-hide-dronekit-python-api-messages%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    1
    down vote



    accepted










    Just create a dummy printing function that do nothing.



    def dummy_printer(x):
    pass


    Then pass it to the status_printer argument.



    vehicle = connect('/dev/ttyS0', heartbeat_timeout = 30, baud = 57600, status_printer = dummy_printer)





    share|improve this answer

























      up vote
      1
      down vote



      accepted










      Just create a dummy printing function that do nothing.



      def dummy_printer(x):
      pass


      Then pass it to the status_printer argument.



      vehicle = connect('/dev/ttyS0', heartbeat_timeout = 30, baud = 57600, status_printer = dummy_printer)





      share|improve this answer























        up vote
        1
        down vote



        accepted







        up vote
        1
        down vote



        accepted






        Just create a dummy printing function that do nothing.



        def dummy_printer(x):
        pass


        Then pass it to the status_printer argument.



        vehicle = connect('/dev/ttyS0', heartbeat_timeout = 30, baud = 57600, status_printer = dummy_printer)





        share|improve this answer












        Just create a dummy printing function that do nothing.



        def dummy_printer(x):
        pass


        Then pass it to the status_printer argument.



        vehicle = connect('/dev/ttyS0', heartbeat_timeout = 30, baud = 57600, status_printer = dummy_printer)






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 10 at 1:08









        Agustinus Baskara

        14117




        14117






























             

            draft saved


            draft discarded



















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53192723%2fhow-to-hide-dronekit-python-api-messages%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            這個網誌中的熱門文章

            Tangent Lines Diagram Along Smooth Curve

            Yusuf al-Mu'taman ibn Hud

            Zucchini