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

add rosnode for switchbot #260

Merged
merged 19 commits into from
Jul 21, 2021
Merged

Conversation

mqcmd196
Copy link
Member

@mqcmd196 mqcmd196 commented Jun 8, 2021

The rosnode for using switchbot.

@mqcmd196 mqcmd196 changed the title add rosnode for switchbot [WIP]add rosnode for switchbot Jun 8, 2021
switchbot_ros/package.xml Outdated Show resolved Hide resolved
switchbot_ros/package.xml Show resolved Hide resolved
switchbot_ros/CMakeLists.txt Outdated Show resolved Hide resolved
switchbot_ros/scripts/switchbot_ros.py Outdated Show resolved Hide resolved
switchbot_ros/msg/CommandTopic.msg Outdated Show resolved Hide resolved
switchbot_ros/msg/CommandTopic.msg Outdated Show resolved Hide resolved
@mqcmd196
Copy link
Member Author

mqcmd196 commented Jun 9, 2021

@k-okada By the way, I found the official Web API at https://github.com/OpenWonderLabs/SwitchBotAPI#getting-started . (To see the commit log, this API was released after my bthesis.) If we use it, I think we don't have to use the IFTTT anymore. Should I make switchbot_ros based on this API?

@mqcmd196
Copy link
Member Author

mqcmd196 commented Jun 9, 2021

I confirmed this API works with our lab's switchbots.

@k-okada
Copy link
Member

k-okada commented Jun 9, 2021

I see , it make sense that switchbot_ros package uses SwitchBot API.

@mqcmd196
Copy link
Member Author

mqcmd196 commented Jun 9, 2021

Okay, I'll remake this package using API.

@mqcmd196 mqcmd196 marked this pull request as ready for review June 14, 2021 11:54
@mqcmd196 mqcmd196 requested review from k-okada and 708yamaguchi June 14, 2021 11:54
@mqcmd196 mqcmd196 changed the title [WIP]add rosnode for switchbot add rosnode for switchbot Jun 14, 2021
@mqcmd196
Copy link
Member Author

@k-okada It's ready for review.
@708yamaguchi @sktometometo Could you test this PR on your demos, especially Fetch's kitchen demo and Spot's demo? I think it might be work if you follow the README.

Copy link
Member

@708yamaguchi 708yamaguchi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice PR!

  1. Could you please add roseus function so that our robots can easily call /switchbot_ros/goal?
    like below:
(defun control-switchbot (name action)
  (cond ((equal action "xxx")
...
  1. What was the DeviceType of switchbot we have? Bot?
    It would be helpful if you could give me a sample roseus code to turn on and off the lights in the 73B2 room.
    https://github.com/OpenWonderLabs/SwitchBotAPI#send-device-control-commands

@mqcmd196
Copy link
Member Author

mqcmd196 commented Jun 15, 2021

@708yamaguchi

Could you please add roseus function so that our robots can easily call /switchbot_ros/goal?
like below:

ok.

What was the DeviceType of switchbot we have? Bot?
It would be helpful if you could give me a sample roseus code to turn on and off the lights in the 73B2 room.
https://github.com/OpenWonderLabs/SwitchBotAPI#send-device-control-commands

We have bot and meter I think. I'll make sample eus code later.

switchbot_ros/scripts/switchbot.py Outdated Show resolved Hide resolved
switchbot_ros/action/SwitchBotCommand.action Outdated Show resolved Hide resolved
switchbot_ros/launch/switchbot.launch Outdated Show resolved Hide resolved
switchbot_ros/scripts/switchbot.py Outdated Show resolved Hide resolved
switchbot_ros/scripts/switchbot.py Outdated Show resolved Hide resolved
switchbot_ros/scripts/switchbot_ros_server.py Outdated Show resolved Hide resolved
switchbot_ros/scripts/switchbot_ros_server.py Outdated Show resolved Hide resolved
switchbot_ros/scripts/switchbot_ros_server.py Outdated Show resolved Hide resolved
switchbot_ros/scripts/switchbot_ros_server.py Outdated Show resolved Hide resolved
switchbot_ros/scripts/switchbot_ros_server.py Outdated Show resolved Hide resolved
@knorth55
Copy link
Member

for efficient python coding, you can use flake8 to check your code.
pip install flake8

@mqcmd196
Copy link
Member Author

@knorth55 Thanks, I fixed.
@708yamaguchi I added the euslisp code. Could you try it?

@mqcmd196
Copy link
Member Author

To use on eus,

roslaunch switchbot_ros switchbot.launch token:=YOURTOKEN
(load "package://switchbot_ros/scripts/switchbot.l")
;; Please setup your device name by your phone at first. Please see readme.
(control-device "/eng2/7f/73b2/light1" "turnOn")

Copy link
Member

@knorth55 knorth55 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, but I found few more changes.

switchbot_ros/scripts/switchbot.py Outdated Show resolved Hide resolved
switchbot_ros/scripts/switchbot_ros_server.py Outdated Show resolved Hide resolved
switchbot_ros/scripts/switchbot_ros_server.py Outdated Show resolved Hide resolved
switchbot_ros/scripts/switchbot_ros_server.py Outdated Show resolved Hide resolved
switchbot_ros/scripts/switchbot_ros_server.py Outdated Show resolved Hide resolved
switchbot_ros/scripts/switchbot_ros_server.py Outdated Show resolved Hide resolved
switchbot_ros/scripts/switchbot.py Outdated Show resolved Hide resolved
switchbot_ros/scripts/switchbot.py Outdated Show resolved Hide resolved
@mqcmd196
Copy link
Member Author

Okay, I fixed.

@mqcmd196 mqcmd196 requested a review from knorth55 June 15, 2021 05:54
switchbot_ros/scripts/switchbot_ros_server.py Outdated Show resolved Hide resolved
switchbot_ros/scripts/switchbot_ros_server.py Outdated Show resolved Hide resolved
switchbot_ros/scripts/switchbot_ros_server.py Outdated Show resolved Hide resolved
switchbot_ros/scripts/switchbot_ros_server.py Outdated Show resolved Hide resolved
@mqcmd196 mqcmd196 requested a review from k-okada June 20, 2021 05:56
@mqcmd196
Copy link
Member Author

Was the travis timeout?

Copy link
Member

@k-okada k-okada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mqcmd196 please add elevator example, also create an image/slide that explain this system

@mqcmd196
Copy link
Member Author

I updated README

@k-okada k-okada merged commit fc36104 into jsk-ros-pkg:master Jul 21, 2021
@mqcmd196 mqcmd196 deleted the switchbot_ros branch July 21, 2021 02:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants