Skip to content

Commit

Permalink
Merge pull request #9 from alpyca/refactor_structure
Browse files Browse the repository at this point in the history
Refactor structure
  • Loading branch information
arturmiller committed Jan 15, 2019
2 parents dc7b9d7 + db3e8f3 commit 800f850
Show file tree
Hide file tree
Showing 24 changed files with 61 additions and 25 deletions.
20 changes: 20 additions & 0 deletions alpyca_comm/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
cmake_minimum_required(VERSION 2.8.3)
project(alpyca_comm)

find_package(catkin REQUIRED COMPONENTS
rospy
message_generation
std_msgs)

catkin_python_setup()

add_service_files(DIRECTORY srv FILES ExampleSrv.srv)
generate_messages(DEPENDENCIES std_msgs)

catkin_install_python(PROGRAMS
src/alpyca/__init__.py
src/alpyca/comm/__init__.py
src/alpyca/comm/communication.py
src/alpyca/comm/example.py
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}/aplyca)

File renamed without changes.
8 changes: 1 addition & 7 deletions package.xml → alpyca_comm/package.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<package>
<name>alpyca</name>
<name>alpyca_comm</name>
<version>0.0.1</version>
<description>The main idea of Alpyca is to make robot development with ROS as easy as possible.</description>

Expand All @@ -12,16 +12,10 @@
<buildtool_depend>catkin</buildtool_depend>
<build_depend>message_generation</build_depend>
<build_depend>std_msgs</build_depend>
<build_depend>pybind11_catkin</build_depend>
<build_depend>gazebo_ros</build_depend>
<build_depend>roscpp</build_depend>

<run_depend>message_runtime</run_depend>
<run_depend>rospy</run_depend>
<run_depend>roslaunch</run_depend>
<run_depend>std_msgs</run_depend>
<run_depend>pybind11_catkin</run_depend>
<run_depend>gazebo_ros</run_depend>
<run_depend>roscpp</run_depend>

</package>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
21 changes: 4 additions & 17 deletions CMakeLists.txt → alpyca_sim/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
cmake_minimum_required(VERSION 2.8.3)
project(alpyca)
project(alpyca_sim)

find_package(PythonLibs REQUIRED)

find_package(catkin REQUIRED COMPONENTS
rospy
message_generation
std_msgs
gazebo_ros
roscpp
pybind11_catkin)
pybind11_catkin
)

catkin_python_setup()

add_service_files(DIRECTORY srv FILES ExampleSrv.srv)
generate_messages(DEPENDENCIES std_msgs)

catkin_package(
LIBRARIES
CATKIN_DEPENDS pybind11_catkin
)

find_package(gazebo REQUIRED)

find_package(PythonLibs REQUIRED)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GAZEBO_CXX_FLAGS}")
Expand All @@ -40,12 +36,3 @@ pybind_add_module(py_contact_sensor MODULE src/alpyca/sim/py_contact_sensor.cpp)

add_library(plugin_runner SHARED src/alpyca/sim/plugin_runner.cpp)
target_link_libraries(plugin_runner ${catkin_LIBRARIES} ${GAZEBO_LIBRARIES} ${PYTHON_LIBRARIES})


catkin_install_python(PROGRAMS
src/alpyca/__init__.py
src/alpyca/comm/__init__.py
src/alpyca/comm/communication.py
src/alpyca/comm/example.py
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}/aplyca)

2 changes: 1 addition & 1 deletion src/alpyca/sim/README.md → alpyca_sim/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ writing plugins keeps being a hard task. Error messages are often cryptic, debug
It would be much nicer to write plugins in Python. This is what alpyca/sim is for.

## Example usage
You can write a contact sensor plugin, exactly as in the [Gazebo tutorials](http://gazebosim.org/tutorials?tut=contact_sensor), but completely in Python. An example can be found in [contact_plugin.py](contact_plugin.py).
You can write a contact sensor plugin, exactly as in the [Gazebo tutorials](http://gazebosim.org/tutorials?tut=contact_sensor), but completely in Python. An example can be found in [contact_plugin.py](src/alpyca/sim/contact_plugin.py).

```python
class ContactPlugin:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
24 changes: 24 additions & 0 deletions alpyca_sim/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0"?>
<package>
<name>alpyca_sim</name>
<version>0.0.1</version>
<description>The alpyca_sim package</description>

<maintainer email="amiller89@gmx.de">amiller</maintainer>
<author email="amiller89@gmx.de">Artur Miller</author>
<author email="boehle@gmail.com">Sebastian Boehle</author>

<license>MIT</license>

<buildtool_depend>catkin</buildtool_depend>

<build_depend>pybind11_catkin</build_depend>
<build_depend>gazebo_ros</build_depend>
<build_depend>roscpp</build_depend>

<run_depend>pybind11_catkin</run_depend>
<run_depend>gazebo_ros</run_depend>
<run_depend>roscpp</run_depend>

</package>

11 changes: 11 additions & 0 deletions alpyca_sim/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## ! DO NOT MANUALLY INVOKE THIS setup.py, USE CATKIN INSTEAD

from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup

# fetch values from package.xml
setup_args = generate_distutils_setup(
packages=['alpyca'],
package_dir={'': 'src'})

setup(**setup_args)
File renamed without changes.
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 800f850

Please sign in to comment.