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

[switchbot_ros] use python setup to avoid relative import in switchbot_ros #278

Merged
merged 3 commits into from
Sep 8, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions switchbot_ros/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ find_package(
actionlib_msgs
)

catkin_python_setup()

add_action_files(
FILES
SwitchBotCommand.action
Expand All @@ -16,3 +18,7 @@ generate_messages(
std_msgs
actionlib_msgs
)

catkin_package()

include_directories()
12 changes: 7 additions & 5 deletions switchbot_ros/package.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<package>
<package format="3">
<name>switchbot_ros</name>
<version>2.1.24</version>
<description>use switchbot with ros</description>
Expand All @@ -10,11 +10,13 @@
<license>BSD</license>

<buildtool_depend>catkin</buildtool_depend>
<buildtool_depend condition="$ROS_PYTHON_VERSION == 2">python-setuptools</buildtool_depend>
<buildtool_depend condition="$ROS_PYTHON_VERSION == 3">python3-setuptools</buildtool_depend>

<run_depend>python-requests</run_depend>
<run_depend>message_runtime</run_depend>
<run_depend>rospy</run_depend>
<run_depend>std_msgs</run_depend>
<exec_depend>python-requests</exec_depend>
<exec_depend>message_exectime</exec_depend>
<exec_depend>rospy</exec_depend>
<exec_depend>std_msgs</exec_depend>

<export>
</export>
Expand Down
2 changes: 1 addition & 1 deletion switchbot_ros/scripts/switchbot_ros_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from switchbot_ros.msg import SwitchBotCommandAction
from switchbot_ros.msg import SwitchBotCommandFeedback
from switchbot_ros.msg import SwitchBotCommandResult
from switchbot import SwitchBotAPIClient
from switchbot_ros.switchbot import SwitchBotAPIClient


class SwitchBotAction:
Expand Down
11 changes: 11 additions & 0 deletions switchbot_ros/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from catkin_pkg.python_setup import generate_distutils_setup
from setuptools import find_packages
from setuptools import setup


d = generate_distutils_setup(
packages=find_packages('src'),
package_dir={'': 'src'},
)

setup(**d)
Empty file.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python
from __future__ import print_function

import json
Expand Down