command.py
Go to the documentation of this file.
1 # -*- coding: utf-8 -*-
2 # vim:set ts=4 sw=4 et:
3 #
4 # Copyright 2014,2015 Vladimir Ermakov.
5 #
6 # This file is part of the mavros package and subject to the license terms
7 # in the top-level LICENSE file of the mavros repository.
8 # https://github.com/mavlink/mavros/tree/master/LICENSE.md
9 
10 __all__ = (
11  'long',
12  'int',
13  'arming',
14  'set_home',
15  'takeoff',
16  'land',
17  'trigger_control',
18 )
19 
20 import rospy
21 import mavros
22 
23 from mavros_msgs.srv import CommandLong, CommandInt, CommandBool, CommandHome, CommandTOL, CommandTriggerControl, CommandTriggerInterval
24 
25 
26 def _get_proxy(service, type):
27  return rospy.ServiceProxy(mavros.get_topic('cmd', service), type)
28 
29 
30 long = None
31 int = None
32 arming = None
33 set_home = None
34 takeoff = None
35 land = None
36 trigger_control = None
37 
38 
40  global long, int, arming, set_home, takeoff, land, trigger_control
41  long = _get_proxy('command', CommandLong)
42  int = _get_proxy('command_int', CommandInt)
43  arming = _get_proxy('arming', CommandBool)
44  set_home = _get_proxy('set_home', CommandHome)
45  takeoff = _get_proxy('takeoff', CommandTOL)
46  land = _get_proxy('land', CommandTOL)
47  trigger_control = _get_proxy('trigger_control', CommandTriggerControl)
48  trigger_interval = _get_proxy('trigger_interval', CommandTriggerInterval)
49 
50 
51 # register updater
def _get_proxy(service, type)
Definition: command.py:26
def get_topic(args)
Definition: __init__.py:49
def register_on_namespace_update(cb)
Definition: __init__.py:41
def _setup_services()
Definition: command.py:39


mavros
Author(s): Vladimir Ermakov
autogenerated on Tue Jun 1 2021 02:36:26