Skip to content

Commit a750ce3

Browse files
committed
Use relative imports, housekeeping++
1 parent d165763 commit a750ce3

File tree

17 files changed

+107
-94
lines changed

17 files changed

+107
-94
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 2.8.3)
1+
cmake_minimum_required(VERSION 3.0.2)
22
project(roslaunch2)
33

44
find_package(catkin REQUIRED)

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* [License & Citing](#cite)
88

99
# Overview <a name="overview"/>
10-
roslaunch2 is a (pure Python based) ROS package that facilitates writing **versatile, flexible and dynamic launch configurations for the Robot Operating System (ROS 1) using Python**, both for simulation and real hardware setups, as contrasted with the existing XML based launch file system of ROS, namely [roslaunch](http://wiki.ros.org/roslaunch). Note that roslaunch2 is not (yet) designed and developed for ROS 2 but for ROS 1 only although it may also inspire the development (of the launch system) of ROS 2. It is **compatible with all ROS versions providing roslaunch** which is used as its backend. roslaunch2 has been tested and heavily used on ROS Indigo, Jade, Kinetic, and Lunar; it also supports a “dry-mode” to generate launch files without ROS being installed at all. The **key features** of roslaunch2 are
10+
roslaunch2 is a (pure Python based) ROS package that facilitates writing **versatile, flexible and dynamic launch configurations for the Robot Operating System (ROS 1) using Python**, both for simulation and real hardware setups, as contrasted with the existing XML based launch file system of ROS, namely [roslaunch](http://wiki.ros.org/roslaunch). Note that roslaunch2 is not (yet) designed and developed for ROS 2 but for ROS 1 only although it may also inspire the development (of the launch system) of ROS 2. It is **compatible with all ROS versions providing roslaunch** which is used as its backend. roslaunch2 has been tested and used on ROS Indigo, Jade, Kinetic, Lunar, Melodic, and Noetic; it also supports a “dry-mode” to generate launch files without ROS being installed at all. The **key features** of roslaunch2 are
1111
- versatile control structures (conditionals, loops),
1212
- extended support for launching and querying information remotely,
1313
- an easy-to-use API for also launching from Python based ROS nodes dynamically, as well as
@@ -106,6 +106,6 @@ The entire code is **BSD 3-Clause licenced**, see [here](https://github.com/Code
106106
}
107107
```
108108

109-
Copyright (c) 2017-2019, Adrian Böckenkamp, Department of Computer Science VII, TU Dortmund University.
109+
Copyright (c) 2017-2020, Adrian Böckenkamp, Department of Computer Science VII, TU Dortmund University.
110110

111111
All rights reserved.

package.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2-
<package format="2">
2+
<package format="3">
33
<name>roslaunch2</name>
44
<version>0.0.1</version>
55
<description>
@@ -18,9 +18,12 @@
1818
<buildtool_depend>catkin</buildtool_depend>
1919

2020
<build_depend>python-catkin-pkg</build_depend>
21+
<buildtool_depend condition="$ROS_PYTHON_VERSION == 3">python3-setuptools</buildtool_depend>
22+
<buildtool_depend condition="$ROS_PYTHON_VERSION == 2">python-setuptools</buildtool_depend>
2123

2224
<exec_depend>python-enum34-pip</exec_depend>
2325
<exec_depend version_gte="4.62">pyro4</exec_depend>
2426
<exec_depend>python-rospkg</exec_depend>
2527
<exec_depend>roslaunch</exec_depend>
28+
<exec_depend>rosbash</exec_depend>
2629
</package>

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33

4-
from distutils.core import setup
4+
from setuptools import setup
55
from catkin_pkg.python_setup import generate_distutils_setup
66

77
d = generate_distutils_setup(

src/roslaunch2/__init__.py

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@
33
#
44
# Author: Adrian Böckenkamp
55
# License: BSD (https://opensource.org/licenses/BSD-3-Clause)
6-
# Date: 12/11/2019
6+
# Date: 08/06/2020
77

88
# Import all submodules typically used in launch modules:
9-
from group import *
10-
from parameter import *
11-
from machine import *
12-
from package import *
13-
from logger import *
14-
from utils import *
15-
from remote import *
16-
from launch import *
17-
from node import *
18-
from environment import *
19-
from test import *
20-
from helpers import *
9+
from .group import *
10+
from .parameter import *
11+
from .machine import *
12+
from .package import *
13+
from .logger import *
14+
from .utils import *
15+
from .remote import *
16+
from .launch import *
17+
from .node import *
18+
from .environment import *
19+
from .test import *
20+
from .helpers import *
2121

2222
import argparse
2323

@@ -172,7 +172,8 @@ def terminate(instance):
172172
def main(command_line_args=None):
173173
"""
174174
Defines the core logic (= Python based dynamic launch files) of roslaunch2. It does NOT create any
175-
launch modules or the like.
175+
launch modules or the like. This function is not meant to be called directly. See `start()` and
176+
`start_async()` for more details.
176177
177178
:param command_line_args: List with command line arguments as strings
178179
:return: None

src/roslaunch2/environment.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
#
44
# Author: Adrian Böckenkamp
55
# License: BSD (https://opensource.org/licenses/BSD-3-Clause)
6-
# Date: 13/03/2018
6+
# Date: 08/06/2020
77

88
import lxml.etree
99
import warnings
1010

11-
import interfaces
12-
import machine
11+
from . import interfaces
12+
from . import machine
1313

1414

1515
class EnvironmentVariable(interfaces.GeneratorBase, interfaces.Composable):

src/roslaunch2/group.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
#
44
# Author: Adrian Böckenkamp
55
# License: BSD (https://opensource.org/licenses/BSD-3-Clause)
6-
# Date: 13/03/2018
6+
# Date: 08/06/2020
77

88
import lxml.etree
99
import warnings
1010

11-
import interfaces
12-
import remapable
13-
import node
14-
import launch
11+
from . import interfaces
12+
from . import remapable
13+
from . import node
14+
from . import launch
1515

1616

1717
class Group(remapable.Remapable, interfaces.Composer, interfaces.Composable):

src/roslaunch2/helpers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
#
44
# Author: Adrian Böckenkamp
55
# License: BSD (https://opensource.org/licenses/BSD-3-Clause)
6-
# Date: 12/11/2019
6+
# Date: 08/06/2020
77

8-
import logger
9-
import node
8+
from . import logger
9+
from . import node
1010

1111

1212
class Helpers:

src/roslaunch2/interfaces.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Author: Adrian Böckenkamp
55
# License: BSD (https://opensource.org/licenses/BSD-3-Clause)
6-
# Date: 26/01/2018
6+
# Date: 08/06/2020
77

88
import copy
99
import lxml.etree
@@ -126,9 +126,9 @@ def add_env_variables_to_nodes(self, environment_variable_dict=None):
126126
"""
127127
if environment_variable_dict is None:
128128
environment_variable_dict = {}
129-
from environment import EnvironmentVariable
130-
from group import Group
131-
from node import Node
129+
from .environment import EnvironmentVariable
130+
from .group import Group
131+
from .node import Node
132132

133133
# Copy dict to not change the argument in higher recursion levels:
134134
tmp_env_dict = dict(environment_variable_dict)

src/roslaunch2/launch.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
#
44
# Author: Adrian Böckenkamp
55
# License: BSD (https://opensource.org/licenses/BSD-3-Clause)
6-
# Date: 13/03/2018
6+
# Date: 08/06/2020
77

88
import warnings
99
import lxml.etree
1010

11-
import interfaces
12-
import machine
13-
import remapable
14-
import node
15-
import group
11+
from . import interfaces
12+
from . import machine
13+
from . import remapable
14+
from . import node
15+
from . import group
1616

1717

1818
class Launch(interfaces.Composable, interfaces.Composer, remapable.Remapable):

0 commit comments

Comments
 (0)