mirror of
https://github.com/CopterExpress/clever-show.git
synced 2026-05-26 15:13:26 +00:00
Client: Updates for compability with clover and simulations
This commit is contained in:
@@ -6,7 +6,13 @@ import time
|
||||
import logging
|
||||
import threading
|
||||
import rospy
|
||||
from clever import srv
|
||||
|
||||
# for backward compatibility with clever
|
||||
try:
|
||||
from clever import srv
|
||||
except ImportError:
|
||||
from clover import srv
|
||||
|
||||
from mavros_msgs.srv import SetMode
|
||||
from mavros_msgs.srv import CommandBool
|
||||
from std_srvs.srv import Trigger
|
||||
@@ -337,7 +343,7 @@ def takeoff(height=TAKEOFF_HEIGHT, speed=TAKEOFF_SPEED, tolerance=TOLERANCE, fra
|
||||
return 'interrupted'
|
||||
|
||||
climb = abs(get_telemetry_locked(frame_id=frame_id).z - start.z)
|
||||
rospy.logdebug("Takeoff to {:.2f} of {:.2f} meters".format(climb, height))
|
||||
rospy.loginfo("Takeoff to {:.2f} of {:.2f} meters".format(climb, height))
|
||||
|
||||
time_passed = time.time() - time_start
|
||||
|
||||
|
||||
@@ -4,7 +4,13 @@ import time
|
||||
import math
|
||||
import rospy
|
||||
import numpy
|
||||
from clever import srv
|
||||
|
||||
# for backward compatibility with clever
|
||||
try:
|
||||
from clever import srv
|
||||
except ImportError:
|
||||
from clover import srv
|
||||
|
||||
import datetime
|
||||
import logging
|
||||
import threading
|
||||
@@ -13,7 +19,6 @@ import subprocess
|
||||
from collections import namedtuple
|
||||
|
||||
from FlightLib import FlightLib
|
||||
from FlightLib import LedLib
|
||||
|
||||
import client
|
||||
|
||||
@@ -86,6 +91,7 @@ class CopterClient(client.Client):
|
||||
rospy.loginfo("Init ROS node")
|
||||
rospy.init_node('clever_show_client')
|
||||
if self.config.led_use:
|
||||
from FlightLib import LedLib
|
||||
LedLib.init_led(self.config.led_pin)
|
||||
task_manager_instance.start() # TODO move to self
|
||||
if self.config.copter_frame_id == "floor":
|
||||
|
||||
@@ -5,7 +5,13 @@ import time
|
||||
import math
|
||||
import logging
|
||||
import threading
|
||||
from clever.srv import SetAttitude
|
||||
|
||||
# for backward compatibility with clever
|
||||
try:
|
||||
from clever import SetAttitude
|
||||
except ImportError:
|
||||
from clover import SetAttitude
|
||||
|
||||
from sensor_msgs.msg import Range
|
||||
from mavros_msgs.msg import State, PositionTarget
|
||||
from mavros_msgs.srv import SetMode, CommandBool
|
||||
@@ -16,7 +22,7 @@ from geometry_msgs.msg import PoseStamped
|
||||
import inspect # Add parent dir to PATH to import messaging_lib
|
||||
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
|
||||
parent_dir = os.path.dirname(current_dir)
|
||||
sys.path.insert(0, parent_dir)
|
||||
sys.path.insert(0, parent_dir)
|
||||
|
||||
from config import ConfigManager
|
||||
|
||||
|
||||
Reference in New Issue
Block a user