-
Notifications
You must be signed in to change notification settings - Fork 988
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
33 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,34 @@ | ||
# -*- python -*- | ||
# -*- coding: utf-8 -*- | ||
# vim:set ts=4 sw=4 et: | ||
|
||
__all__ = ( | ||
'get_namespace', | ||
'set_namespace', | ||
'get_topic' | ||
) | ||
|
||
# global namespace storage | ||
_mavros_ns = "/mavros" | ||
|
||
|
||
def get_namespace(): | ||
""" | ||
Returns mavros node namespace | ||
""" | ||
global _mavros_ns | ||
return _mavros_ns | ||
|
||
|
||
def set_namespace(ns): | ||
""" | ||
Sets namespace of mavros node | ||
""" | ||
global _mavros_ns | ||
_mavros_ns = ns | ||
|
||
|
||
def get_topic(*args): | ||
""" | ||
Create topic name for mavros node | ||
""" | ||
return '/'.join((get_namespace(), ) + args) |