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

Enable catkin_virtualenv and google_chat_ros (and others) #1864

Open
wants to merge 79 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
de7a887
[jsk_unitree_startup/cross] Add python3-venv for catkin virtualenv
iory Jul 25, 2022
f9d4bac
[jsk_unitree_startup/cross] Use sitecustomize.py instead of setting P…
iory Jul 26, 2022
554a87b
[jsk_unitree_startup/cross] Recursively append python site/dist-packa…
iory Jul 26, 2022
f52c4de
[jsk_unitree_startup/cross] Add google_chat_ros
iory Jul 26, 2022
dd38754
[jsk_unitree_startup/cross] Use bug-fix version of catkin-virtualenv
iory Jul 26, 2022
c0b2cc8
[jsk_unitree_startup/cross] Install python3 dependencies for catkin_v…
iory Jul 26, 2022
5337838
[jsk_unitree_startup/cross] Add JSK_UNITREE_COMPILE_PARALLEL option t…
iory Jul 26, 2022
785af9e
[jsk_unitree_startup/cross] Install sitecustomize.py for real unitree…
iory Jul 26, 2022
1e045b1
[jsk_unitree_startup] Fixed install.sh command description. -d is cor…
iory Jul 26, 2022
bba78e2
[jsk_unitree_startup] Use perl instead of 'grep -Po'
iory Jul 26, 2022
b1c13cd
[jsk_unitree_startup/cross] Install LTE settings only TARGET_DIRECTOR…
iory Jul 26, 2022
f55266b
[jsk_unitree_startup/cross] Use sshpass instead of /usr/bin/sshpass
iory Jul 26, 2022
1c21dd2
[jsk_unitree_startup/cross] Use bug-fix branch for enabling aarch64 (…
iory Jul 26, 2022
c60b7d9
[jsk_unitree_startup/cross] Set default value 4 to JSK_UNITREE_COMPIL…
iory Jul 26, 2022
ce8e63a
Revert "[jsk_unitree_startup/cross] Add JSK_UNITREE_COMPILE_PARALLEL …
iory Jul 27, 2022
5cf2dec
Revert "[jsk_unitree_startup/cross] Set default value 4 to JSK_UNITRE…
iory Jul 27, 2022
6023c36
[jsk_unitree_startup/cross] Passthrough MAKEFLAGS
iory Jul 27, 2022
b9bbd11
[jsk_unitree_startup/cross] Add comments for unitree.repos
iory Jul 27, 2022
e753fba
[jsk_unitree_startup/cross] Passthrough python libraries on run_user.sh
iory Jul 28, 2022
ff338cf
[unitree/cross] Add prerequisite command to readme
tkmtnt7000 Jul 28, 2022
33cf239
[jsk_unitree_startup/cross] Modified google_chat_ros branch
iory Jul 29, 2022
3e1247f
[jsk_unitree_startup/cross] Add comment for reachability
iory Jul 29, 2022
d6c223f
Revert "[jsk_unitree_startup/cross] Add python3-venv for catkin virtu…
iory Jul 29, 2022
4b5dd18
[jsk_unitree_startup/cross] Enable virtualenv via pip install
iory Jul 29, 2022
706a5b2
[jsk_unitree_startup/cross] Use unitree branch at catkin_virtualenv
iory Jul 29, 2022
e578bb8
[jsk_unitree_startup/cross] Install sysctl.conf to passthrough packet
iory Jul 30, 2022
82acc9f
[jsk_unitree_startup/cross] Install iptables.ipv4.nat to passthrough …
iory Jul 30, 2022
1a67515
[jsk_unitree_startup/cross] Add OPTIONS to passthrough user id for ma…
iory Aug 3, 2022
91961fd
[jsk_unitree_startup/cross] Enable iory's google chat ros (minor change)
iory Aug 3, 2022
f7e6089
[jsk_unitree_startup/cross] Add compress command
iory Aug 3, 2022
d1c49ac
[jsk_unitree_startup] Add emotion reaction
a-ichikura Aug 4, 2022
0231f70
[jsk_unitree_startup/cross] Add y or n
iory Aug 4, 2022
f8e3778
[jsk_unitree_startup] Add imageai.sh which is running on default unit…
iory Aug 5, 2022
8d9eb4a
[jsk_unitree_startup] Launch trt pose on jetson nano2gb (192.168.123.13)
iory Aug 5, 2022
2b7943c
[jsk_unitree_startup] Add camera image publisher
iory Aug 5, 2022
c9f5b1a
[jsk_unitree_startup] Add walk_notifyer
iory Aug 7, 2022
d3d98cc
[jsk_unitree_startup/cross] Add env.sh for machine tag
iory Aug 7, 2022
e84bafd
[jsk_unitree_startup] Add walk_notifier application
iory Aug 7, 2022
11964cf
[jsk_unitree_startup] Add wlan2 settings for sparky
iory Aug 7, 2022
5813abd
[jsk_unitree_startup/cross] Install mailutils
iory Aug 7, 2022
8758d43
[jsk_unitree_startup] Enable wlan0
iory Aug 7, 2022
6e47211
[jsk_unitree_startup/install] passthrough password
iory Aug 7, 2022
6cf0090
[jsk_unitree_startup/install] Modified owner of /var/mail/${USER}
iory Aug 7, 2022
ac6b6cc
Merge branch 'unitree-virtualenv' into unitree-miraikan
iory Aug 7, 2022
c2cb48c
[jsk_unitree_startup/WalkNotifier] Enable attachment
iory Aug 7, 2022
95fdfa5
[jsk_unitree_startup] Update version of mailutils
iory Aug 7, 2022
15260f7
[jsk_unitree_startup/cross] Disable python for mailutils
iory Aug 7, 2022
fca125f
[jsk_unitree_startup/install.sh] Use sudo for touch /var/mail/unitree
iory Aug 8, 2022
d541c81
[jsk_unitree_startup] Add Walk notifier's README
iory Aug 8, 2022
722b3fb
[jsk_unitree_startup/cross] Add y or n
iory Aug 4, 2022
749f486
[jsk_perception_3rdparty] Passthrough password
iory Aug 8, 2022
e1c68e5
[jsk_unitree_startup] Fixed start_app's rosservice names
iory Aug 8, 2022
262cd73
Merge branch 'unitree-miraikan' into unitree-virtualenv
iory Aug 26, 2022
14022cd
Revert "[jsk_unitree_startup] Update version of mailutils"
iory Aug 27, 2022
69874b1
Revert "[jsk_unitree_startup/cross] Disable python for mailutils"
iory Aug 27, 2022
f13a43d
enable to send mail
tkmtnt7000 Jul 26, 2022
2fe8f21
add more typecheck, use rospy.loginfo for message
k-okada Jul 27, 2022
d4f0597
use https://github.com/tkmtnt7000/jsk_robot/pull/5 to publish image s…
k-okada Jul 27, 2022
cc1777f
enable to receive multiple smach state
k-okada Aug 9, 2022
0dd909e
add to pubilsh /tweet message
k-okada Aug 9, 2022
0bfbf79
[jsk_robot_startup] Fix dependent on linter
tkmtnt7000 Jul 28, 2022
7d1958e
[jsk_robot_startup] Support python3 in smach_to_mail.py
tkmtnt7000 Jul 28, 2022
a935e96
[jsk_robot_startup/smach_mail] Fix typo
tkmtnt7000 Aug 9, 2022
f3933dd
[jsk_robot_startup/smach_mail] Remove unused module
tkmtnt7000 Aug 9, 2022
3d41642
[jsk_robot_startup/smach_to_mail] Set sender address and receiver add…
tkmtnt7000 Aug 9, 2022
2542efd
[jsk_robot_startup/smach_to_mail] Raise error when no address is set
tkmtnt7000 Aug 22, 2022
1075757
[jsk_robot_startup/smach_to_mail] Use yaml file to set address
tkmtnt7000 Aug 22, 2022
54a3d1a
[jsk_robot_startup] Publish whole /tweet at a time
iory Aug 22, 2022
7a4f018
[jsk_robot_startup] Add Readme for smach_to_mail.py
tkmtnt7000 Aug 23, 2022
cfdfc6e
Revert "[jsk_unitree_startup] Launch trt pose on jetson nano2gb (192.…
iory Aug 29, 2022
eb02f63
Revert "[jsk_unitree_startup] Add imageai.sh which is running on defa…
iory Aug 29, 2022
20cd79e
[jsk_unitree_startup] Copy data to jetson nano 2gb (192.168.123.13)
iory Aug 29, 2022
70cc9f9
[jsk_unitree_startup] Publish image via mqtt
iory Aug 29, 2022
096165e
[jsk_robot_startup] Add EmailBody msg
tkmtnt7000 May 24, 2022
8763099
[jsk_robot_startup] Support changing embed image size and change msg …
tkmtnt7000 May 25, 2022
56f41d7
add img_data to EmailBody, update email_topic.py and email-topic-clie…
k-okada Jul 27, 2022
61209bc
add node to publish smach_state of lead_teleop program
k-okada Jun 29, 2022
c3b18f9
[jsk_unitree_startup/human_pose_publisher.py] Add timestamp for peopl…
iory Aug 29, 2022
e6ab483
[jsk_unitree_startup/llead-teleop-state.l] Check detected person
iory Aug 29, 2022
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
Prev Previous commit
Next Next commit
[jsk_unitree_startup] Add emotion reaction
a-ichikura authored and iory committed Aug 4, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit d1c49acd35f0eb05de5ced7b94238832b609e5df
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
display: Emotion Reaction
platform: go1
launch: jsk_unitree_startup/emotion_reaction.xml
interface: jsk_unitree_startup/emotion_reaction.interface
icon: jsk_unitree_startup/emotion_reaction.png
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
published_topics: {}
subscribed_topics: {}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<launch>
<include file="$(find jsk_unitree_startup)/launch/emotion_reaction.launch" >
</include>
</launch>
Original file line number Diff line number Diff line change
@@ -3,3 +3,5 @@ apps:
display: go1 watch dog
- app: jsk_unitree_startup/lead_teleop
display: go1 lead teleop
- app: jsk_unitree_startup/emotion_reaction
display: go1 emotion reaction
Original file line number Diff line number Diff line change
@@ -30,6 +30,7 @@ if [ "$ROS_IP" == "192.168.123.14" ];then
while ! eval rostopic info /robotsound 2$toStartlog; do sleep 2; done
sleep 2 # wait for a while...
roslaunch jsk_unitree_startup unitree_bringup.launch network:=ethernet &
roslaunch jsk_unitree_startup google_chat_ros.launch &
fi

eval echo "[jsk_startup] done... " $toStartlog
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<launch>

<node name="emotion_talker"
pkg="jsk_unitree_startup" type="emotion_talker.py" />
<node name="emotion_subscriber"
pkg="jsk_unitree_startup" type="emotion_subscriber.l" />

</launch>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<launch>
<arg name="google_chat_credentials_json" default="/var/lib/robot/dialogflow/sparky-pdse-c8cd9692a84f.json" />
<arg name="dialogflow_credentials_json" default="/var/lib/robot/dialogflow/facialexpression-rpwe-01533d0109c5.json" />

<!-- Google Chat ROS -->
<include file="$(find google_chat_ros)/launch/google_chat.launch">
<arg name="receiving_mode" value="pubsub" />
<arg name="project_id" value="sparky-pdse" />
<arg name="subscription_id" value="chat-sub" />
<arg name="respawn" value="true" />
<arg name="google_cloud_credentials_json" value="$(arg google_chat_credentials_json)"/>
<arg name="to_dialogflow_client" value="true" />
</include>

<!-- Dialogflow Client ROS -->
<include file="$(find dialogflow_task_executive)/launch/dialogflow_ros.launch">
<arg name="credential" value="$(arg dialogflow_credentials_json)" />
<arg name="project_id" value="facialexpression-rpwe" />
<arg name="enable_hotword" value="false" />
</include>

</launch>
Original file line number Diff line number Diff line change
@@ -39,6 +39,12 @@
args="call --wait /robot/start_app 'name: jsk_unitree_startup/lead_teleop'"
output="screen" />

<!-- start emotion_reaction.launch -->
<node name="rosservice"
pkg="rosservice" type="rosservice"
args="call --wait /robot/start_app 'name: jsk_unitree_startup/emotion_reaction'"
output="screen" />

<!-- let people to know unitree is bringup -->
<node pkg="jsk_unitree_startup" type="wakeup.l"
name="wakeup" output="log" />
48 changes: 48 additions & 0 deletions jsk_unitree_robot/jsk_unitree_startup/scripts/emotion_subscriber.l
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/usr/bin/env roseus

(ros::load-ros-manifest "roseus")

(ros::roseus "emotion-lister")
(load "package://unitreeeus/unitree-interface.l")

(require "package://jsk_unitree_startup/scripts/motions/happy.l")
(require "package://jsk_unitree_startup/scripts/motions/joy.l")
(require "package://jsk_unitree_startup/scripts/motions/affirmation.l")
(require "package://jsk_unitree_startup/scripts/motions/negation.l")
(require "package://jsk_unitree_startup/scripts/motions/love.l")
(require "package://jsk_unitree_startup/scripts/motions/scared.l")
(require "package://jsk_unitree_startup/scripts/motions/curious.l")
(require "package://jsk_unitree_startup/scripts/motions/astonished.l")


(defun emotion-cb(msg)
(let ((emotion (send msg :data)))
(ros::ros-info "Callback chatting-cb called with ~A" emotion)
(cond ((string= emotion "happy")
(happy-main))
((string= emotion "joy")
(joy-main))
((string= emotion "affirmation")
(affirmation-main))
((string= emotion "negation")
(negation-main))
((string= emotion "love")
(love-main))
((string= emotion "scared")
(scared-main))
((string= emotion "curious")
(curious-main))
((string= emotion "astonished")
(astonished-main))
(t
(ros::ros-warn "called unknown emotion ~A" emotion)))
emotion))

(defun main()
(go1-init)
(ros::subscribe "/emotion" std_msgs::String #'emotion-cb)
(ros::rate 10)
(while (ros::ok)
(ros::spin-once)))

(main)
117 changes: 117 additions & 0 deletions jsk_unitree_robot/jsk_unitree_startup/scripts/emotion_talker.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import rospy
from std_msgs.msg import String
from speech_recognition_msgs.msg import SpeechRecognitionCandidates
from jsk_recognition_msgs.msg import PeoplePoseArray
from dialogflow_task_executive.msg import DialogResponse
import time
import message_filters

from threading import Lock


class testNode():
def __init__(self):
# Publisher
self.pub = rospy.Publisher('/emotion', String, queue_size=1)

# Subscriber
self.sub1 = rospy.Subscriber('/speech_to_text', SpeechRecognitionCandidates, self.speech_callback)
self.sub2 = rospy.Subscriber('/people_pose', PeoplePoseArray, callback=self.callback)
self.sub3 = rospy.Subscriber('/dialog_response', DialogResponse, callback=self.df_cb)
self.duration_time = rospy.Duration(30)
self.prev_pose_detected_time = rospy.Time.now() - self.duration_time

self.lock = Lock()

queue_size = 10
fps = 100.
delay = 1 / fps * 0.5

def callback(self, msg):
if (rospy.Time.now() - self.prev_pose_detected_time) < self.duration_time:
return
poses = msg.poses
if len(poses) >= 1:
item = poses[0].limb_names
scores = poses[0].scores
target_limbs = [
"left_eye", "nose", "right_eye", "right_ear",
"left_ear"]
if all([name in item for name in target_limbs]):
message = "happy"
rospy.loginfo("received {}, current emotion is {}".format(item, message))
with self.lock:
self.publish(message)
self.prev_pose_detected_time = rospy.Time.now()
rospy.sleep(5.0)

def publish(self, data):
self.pub.publish(data)

def speech_callback(self, msg):
word = msg.transcript[0]
if word in ["こんにちは",
"ヤッホー",
"こんばんは",
"おはよう",
"おはようございます"]:
message = "happy"
elif word in ["可愛いね",
"可愛い",
"かわいいね",
"かわいい"]:
message = "joy"
elif word in ["散歩に行こう",
"散歩",
"行こう",
"いこう"]:
message = "affirmation"
elif word in ["今日は行けないよ",
"いけないよ",
"行けないよ"]:
message = "negation"
elif word in ["大好きだよ",
"好き",
"すき"]:
message = "love"
elif word in ["あっち行って",
"さようなら"]:
message = "scared"
else:
message = word
rospy.loginfo("received {}, current emotion is {}".format(word, message))
with self.lock:
self.publish(message)
rospy.sleep(5.0)

def df_cb(self, data):
if data.action == "Happy" or data.action == "input.welcome":
self.publish("happy")
elif data.action == "Smirking" or data.action == "Squinting":
self.publish("joy")
elif data.action == "Love":
self.publish("love")
elif data.action == "Fearful" or data.action == "Cry":
self.publish("scared")
elif data.action == "Relived":
self.publish("affirmation")
elif data.action == "Boring" or data.action == "Unpleasant":
self.publish("negation")
elif data.action == "input.unknown":
self.publish("curious")
elif data.action == "Angry" or data.action == "Astonished":
self.publish("astonished")
else:
rospy.logwarn("Unknown emotion")

if __name__ == '__main__':
rospy.init_node('speech_to_emotion')

time.sleep(3.0)
node = testNode()

while not rospy.is_shutdown():
rospy.sleep(0.1)
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/usr/bin/env roseus \

(ros::load-ros-manifest "roseus")
(ros::roseus "unitree-affirmation")
;;(load "package://unitreeeus/unitree-interface.l")

;;down
(defun affirmation-pose-1(&optional (time 3000))
(progn (send *go1* :angle-vector (send *ri* :state :potentio-vector))
(send *ri* :body-pose '(0 0.2 0))
))
;;up
(defun affirmation-pose-2(&optional (time 3000))
(progn (send *go1* :angle-vector (send *ri* :state :potentio-vector))
(send *ri* :body-pose '(0 -0.2 0))
))

(defun reset-pose(&optional (time 3000))
(progn (send *go1* :angle-vector (send *ri* :state :potentio-vector))
(send *go1* :angle-vector #f(0.0 45.0 -90.0 0.0 45.0 -90.0 0.0 45.0 -90.0 0.0 45.0 -90.0))
(send *ri* :body-pose '(0 0 0))
))

(defun affirmation-main()
(print "affirmation")
;;(go1-init)
(reset-pose 1000)
(affirmation-pose-1 800)
(unix:usleep(* 1000 400))
(affirmation-pose-2 800)
(unix:usleep(* 1000 400))
(affirmation-pose-1 800)
(unix:usleep(* 1000 400))
(affirmation-pose-2 800)
(unix:usleep(* 1000 600))

(reset-pose 1000)
(affirmation-pose-1 800)
(unix:usleep(* 1000 400))
(affirmation-pose-2 800)
(unix:usleep(* 1000 400))
(affirmation-pose-1 800)
(unix:usleep(* 1000 400))
(affirmation-pose-2 800)
(unix:usleep(* 1000 600))
)
41 changes: 41 additions & 0 deletions jsk_unitree_robot/jsk_unitree_startup/scripts/motions/astonished.l
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/usr/bin/env roseus

(ros::load-ros-manifest "roseus")
(ros::roseus "unitree-astonished")
;;(load "package://unitreeeus/unitree-interface.l")

(defun astonished-pose-1(&optional (time 3000))
(progn (send *go1* :angle-vector (send *ri* :state :potentio-vector))
(send *go1* :body-pose (coords :pos #f(0 0 30)))
(send *ri* :body-pose (coords :pos #f(0 0 30)))
))

(defun astonished-pose-2(&optional (time 3000))
(progn (send *go1* :angle-vector (send *ri* :state :potentio-vector))
(send *go1* :body-pose '(0 -0.4 0))
(send *ri* :body-pose '(0 -0.4 0))
))

(defun reset-pose(&optional (time 3000))
(progn (send *go1* :angle-vector (send *ri* :state :potentio-vector))
(send *go1* :angle-vector #f(0.0 45.0 -90.0 0.0 45.0 -90.0 0.0 45.0 -90.0 0.0 45.0 -90.0))
(send *ri* :body-pose '(0 0 0))
))

(defun astonished-main()
;;(print "astonished")
;;(go1-init)
;;(make-irtviewer)
;;(send *irtviewer* :draw-objects)
;;(objects (list *go1*))
(reset-pose 1000)
(astonished-pose-1 800)
(unix:usleep (* 1000 1000))
(reset-pose 800)
(unix:usleep (* 1000 400))
(astonished-pose-2 800)
(unix:usleep (* 1000 1000))
(reset-pose 800)
(unix:usleep (* 1000 800))

)
45 changes: 45 additions & 0 deletions jsk_unitree_robot/jsk_unitree_startup/scripts/motions/curious.l
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/usr/bin/env roseus
(ros::load-ros-manifest "roseus")
(ros::roseus "unitree-curious")
(load "package://unitreeeus/unitree-interface.l")

(defun curious-pose-1(&optional (time 3000))
(progn (send *go1* :angle-vector (send *ri* :state :potentio-vector))
(send *go1* :body-pose '(0 -0.4 0))
(send *ri* :body-pose '(0 -0.4 0))
))

(defun curious-pose-2(&optional (time 3000))
(progn (send *go1* :angle-vector (send *ri* :state :potentio-vector))
(send *go1* :body-pose '(0.4 -0.4 0))
(send *ri* :body-pose '(0.4 -0.4 0))
))

(defun curious-pose-3(&optional (time 3000))
(progn (send *go1* :angle-vector (send *ri* :state :potentio-vector))
(send *go1* :body-pose '(-0.4 -0.4 0))
(send *ri* :body-pose '(-0.4 -0.4 0))
))

(defun reset-pose(&optional (time 3000))
(progn (send *go1* :angle-vector (send *ri* :state :potentio-vector))
(send *go1* :angle-vector #f(0.0 45.0 -90.0 0.0 45.0 -90.0 0.0 45.0 -90.0 0.0 45.0 -90.0))
(send *ri* :body-pose '(0 0 0))
))

(defun curious-main()
(print "curious")
(go1-init)
;;(make-irtviewer)
;;(send *irtviewer* :draw-objects)
;;(objects (list *go1*))
(reset-pose 1000)
(curious-pose-1 800)
(unix:usleep (* 1000 800))
(curious-pose-2 800)
(unix:usleep (* 1000 1500))
(curious-pose-3 800)
(unix:usleep (* 1000 1500))
(reset-pose 800)
(unix:usleep (* 1000 800))
)
Loading