How to hide DroneKit-Python API messages
up vote
0
down vote
favorite
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.
dronekit-python dronekit
add a comment |
up vote
0
down vote
favorite
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.
dronekit-python dronekit
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
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
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.
dronekit-python dronekit
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.
dronekit-python dronekit
dronekit-python dronekit
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
add a comment |
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
add a comment |
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)
add a comment |
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)
add a comment |
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)
add a comment |
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)
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)
answered Nov 10 at 1:08
Agustinus Baskara
14117
14117
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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