Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix symlink-install compilation #32

Merged
merged 4 commits into from
Apr 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 0 additions & 48 deletions pybind_ament/CMakeLists.txt

This file was deleted.

8 changes: 0 additions & 8 deletions pybind_ament/cmake/pybind_include.cmake

This file was deleted.

15 changes: 0 additions & 15 deletions pybind_ament/package.xml

This file was deleted.

50 changes: 46 additions & 4 deletions rmf_fleet_adapter_python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,10 @@ include_directories(
${rmf_fleet_adapter_INCLUDE_DIRS}
)

# pybind11 is installed by the pybind_ament package
# You must have the pybind_ament package in your workspace somewhere!
find_package(pybind11_vendor REQUIRED)
find_package(pybind11 REQUIRED)

pybind11_add_module(rmf_adapter
pybind11_add_module(rmf_adapter SHARED
src/adapter.cpp
src/tests.cpp
src/types/types.cpp
Expand All @@ -46,6 +45,7 @@ pybind11_add_module(rmf_adapter
src/battery/battery.cpp
src/schedule/schedule.cpp
)

target_link_libraries(rmf_adapter PRIVATE
rmf_fleet_adapter::rmf_fleet_adapter)

Expand All @@ -65,4 +65,46 @@ target_include_directories(rmf_adapter
${rmf_lift_msgs_INCLUDE_DIRS}
)

# NO AMENT PACKAGE! That's settled by setup.py
# Locate ament_package template files.
set(PYTHON_INSTALL_DIR "lib/python${PYTHON_MAJOR_MINOR}/site-packages")

# Install library for actual use
install(TARGETS rmf_adapter
DESTINATION "${PYTHON_INSTALL_DIR}"
)

# Install Python modules
ament_python_install_package(${PROJECT_NAME})

install(PROGRAMS
scripts/test_adapter.py
scripts/test_utils.py
scripts/test_loop.py
scripts/test_delivery.py
scripts/traffic_light.py
scripts/schedule_blockade_nodes.py
DESTINATION lib/${PROJECT_NAME}
)

# Unit Tests
find_package(ament_cmake_pytest REQUIRED)

if(BUILD_TESTING)
set(_rmf_fleet_adapter_python_tests
tests/unit/test_geometry.py
tests/unit/test_graph.py
tests/unit/test_RobotCommandHandle.py
tests/unit/test_types.py
tests/unit/test_vehicletraits.py
)

foreach(_test_path ${_rmf_fleet_adapter_python_tests})
get_filename_component(_test_name ${_test_path} NAME_WE)
ament_add_pytest_test(${_test_name} ${_test_path}
TIMEOUT 120
WERROR ON
)
endforeach()
endif()

ament_package()
2 changes: 1 addition & 1 deletion rmf_fleet_adapter_python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The `MockAdapter` and `Adapter` both do this. But the difference is that `MockAd
Integration test script for rmf loop and delivery task:

```shell
ros2 run rmf_fleet_adapter_python test_adapter
ros2 run rmf_fleet_adapter_python test_adapter.py
```

You may then probe the effects on the ROS2 graph by subscribing to the following topics with `ros2 topic echo <TOPIC_NAME>`:
Expand Down
6 changes: 4 additions & 2 deletions rmf_fleet_adapter_python/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
<description>Python bindings for the rmf_fleet_adapter</description>
<maintainer email="methylDragon@gmail.com">methylDragon</maintainer>
<license>Apache License 2.0</license>
<depend>pybind_ament</depend>

<depend>pybind11_vendor</depend>
<depend>rclpy</depend>
<depend>rmf_fleet_adapter</depend>

<export>
<build_type>ament_python</build_type>
<build_type>ament_cmake</build_type>
</export>

</package>
Empty file.
67 changes: 0 additions & 67 deletions rmf_fleet_adapter_python/scripts/dispatcher_node.py

This file was deleted.

2 changes: 2 additions & 0 deletions rmf_fleet_adapter_python/scripts/schedule_blockade_nodes.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

# Copyright 2020 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
5 changes: 3 additions & 2 deletions rmf_fleet_adapter_python/scripts/test_adapter.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import rmf_fleet_adapter_python.test_delivery as test_delivery
import rmf_fleet_adapter_python.test_loop as test_loop
#!/usr/bin/env python3

import test_delivery
import test_loop

def main():
test_delivery.main()
Expand Down
8 changes: 5 additions & 3 deletions rmf_fleet_adapter_python/scripts/test_delivery.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

import rclpy
import time
from rclpy.executors import SingleThreadedExecutor
Expand All @@ -12,9 +14,9 @@
import rmf_adapter.type as Type
import rmf_adapter.schedule as schedule

from rmf_fleet_adapter_python.test_utils import MockRobotCommand
from rmf_fleet_adapter_python.test_utils import MockDispenser, MockIngestor
from rmf_fleet_adapter_python.test_utils import TaskSummaryObserver
from test_utils import MockRobotCommand
from test_utils import MockDispenser, MockIngestor
from test_utils import TaskSummaryObserver

from functools import partial

Expand Down
8 changes: 5 additions & 3 deletions rmf_fleet_adapter_python/scripts/test_loop.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

import rclpy
import time
from rclpy.executors import SingleThreadedExecutor
Expand All @@ -11,9 +13,9 @@
import rmf_adapter.plan as plan
import rmf_adapter.type as Type

from rmf_fleet_adapter_python.test_utils import MockRobotCommand
from rmf_fleet_adapter_python.test_utils import MockDispenser, MockIngestor
from rmf_fleet_adapter_python.test_utils import TaskSummaryObserver
from test_utils import MockRobotCommand
from test_utils import MockDispenser, MockIngestor
from test_utils import TaskSummaryObserver

from functools import partial

Expand Down
2 changes: 2 additions & 0 deletions rmf_fleet_adapter_python/scripts/test_utils.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

import rmf_dispenser_msgs.msg as dispenser_msgs
import rmf_ingestor_msgs.msg as ingestor_msgs
from rmf_task_msgs.msg import TaskSummary
Expand Down
2 changes: 2 additions & 0 deletions rmf_fleet_adapter_python/scripts/traffic_light.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python3

# Copyright 2020 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
16 changes: 0 additions & 16 deletions rmf_fleet_adapter_python/setup.cfg

This file was deleted.

Loading