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

[jsk_robot_startup/lifelog] Tweet randomly from uptime #1805

Open
wants to merge 75 commits into
base: develop/pr2-noetic
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
bb4a370
add diagnos_ether_listener.py
Kanazawanaoaki Dec 16, 2021
b664e15
remove unwanted hoge
Kanazawanaoaki Dec 19, 2021
869d40e
rename file to diagnostics_ethercat_summarizer
Kanazawanaoaki Dec 19, 2021
a59731f
Update jsk_pr2_robot/jsk_pr2_startup/jsk_pr2_warning/diagnostics_ethe…
Kanazawanaoaki Apr 26, 2022
d1d03b5
Update jsk_pr2_robot/jsk_pr2_startup/jsk_pr2_warning/diagnostics_ethe…
Kanazawanaoaki Apr 26, 2022
7f405aa
Remove white space
Kanazawanaoaki Apr 26, 2022
0cfe745
tweet coral human pose estimator output
knorth55 Oct 8, 2019
3603778
add tweet_image_server for non-euslisp users
knorth55 May 18, 2021
d7c3bf1
enable monitor driver for pr2 kinect
May 11, 2022
40e48ee
refactor to check None in check_openni_node
May 11, 2022
a17a46a
check openni with raw image
May 11, 2022
fd59c9b
[jsk_pr2_startup] Add audible warning and sanity diagnostics
iory May 19, 2022
7be0309
[jsk_pr2_startup/warning] Add warning_blacklist.yaml
iory May 20, 2022
e6abab2
[jsk_pr2_startup/warning] Check compressed topics for data reduction …
iory May 24, 2022
5dbbce1
[jsk_pr2_startup/warning] Check audio topic for sanity diagnostics
iory May 24, 2022
860fd67
[jsk_pr2_startup] Fix joy node name in diagnostics analyzer
iory May 27, 2022
358d943
[jsk_pr2_startup] Ignore calibration stuck because PR2 speaks this er…
iory May 27, 2022
89341c1
[jsk_pr2_startup/warning] Ignore uncalibrated error
iory May 27, 2022
68cda26
Add roseus_resume interrupt and resume apps
Affonso-Gui Jun 7, 2022
a585d06
avoid dweet error in battery_logger
Jul 4, 2022
0315f2e
[jsk_pr2_startup/audible_warning] Add ignore time after runstop is en…
iory Jun 8, 2022
e493925
[jsk_pr2_startup/audible_warning] Tweet audible warning with image
iory Jun 8, 2022
33f6188
[jsk_pr2_startup/audible_warning] Fixed blacklist format at run_stop …
iory Jul 6, 2022
431f578
[jsk_pr2_startup] Run email_topic.py and smach_to_mail.py by default
tkmtnt7000 Aug 26, 2022
66add5b
[jsk_pr2_startup] Update node name of smach_to_mail to clarify
tkmtnt7000 Aug 31, 2022
ffe5602
[jsk_fetch_startup] catkin clean libcmt before build in daily update_…
708yamaguchi Jan 6, 2022
53657e9
[jsk_fetch_startup] update workspace script
sktometometo Apr 15, 2022
2029993
[jsk_fetch_startup] remove redundant section
sktometometo Apr 16, 2022
a3cbbfd
[jsk_fetch_startup] parameterize workspace path and make it as argument
sktometometo Apr 18, 2022
06a44c1
[jsk_fetch_startup] update update_workspace.sh
sktometometo Apr 18, 2022
38893d6
[jsk_fetch_startup] update workspace script
sktometometo Apr 19, 2022
06b462b
[jsk_fetch_startup] fix default workspace path
sktometometo Apr 20, 2022
a11e0e4
[jsk_fetch_startup] rename update_workspace.sh to update_workspace_ma…
sktometometo Apr 27, 2022
6d59d79
[jsk_fetch_startup] remove /tmp/update_workspace.sh after updating
sktometometo Jul 4, 2022
58ca236
[jsk_fetch_startup] fix mailbody in update_workspace script
sktometometo Sep 15, 2022
18d91bb
[jsk_fetch_startup] fix mailbody in update_workspace script
sktometometo Sep 15, 2022
e556301
[jsk_fetch_startup] Fix email body topic by jsk_robot_startup/EmailBody
tkmtnt7000 Sep 15, 2022
c458f0e
[jsk_fetch_startup] add comment to update_workspace_main.sh
sktometometo Sep 18, 2022
3793320
[jsk_fetch_startup, jsk_robot_startup] move update_workspace_main.sh …
knorth55 Sep 30, 2022
7bfdcd5
[jsk_pr2_startup] add update_workspace.sh for pr2
knorth55 Sep 30, 2022
f87f3a4
[jsk_robot_startup] add option to disable rosdep install
knorth55 Sep 30, 2022
b08e72f
[jsk_pr2_startup] do not run rosdep in pr2
knorth55 Sep 30, 2022
9323403
Apply suggestions from code review
knorth55 Sep 30, 2022
723c6e2
[jsk_robot_startup] fix typo in update_workspace_main.sh
knorth55 Sep 30, 2022
116ae95
use run instead of launch for app_manager
knorth55 Oct 12, 2022
6b50fe7
set allow_parallel false for personal use app
knorth55 Oct 12, 2022
1005496
use run for jsk_pr2_startup/tweet app
knorth55 Oct 12, 2022
c2b1de0
add smach_image_publisher in pr2.launch
knorth55 Oct 14, 2022
1d95242
update jsk_startup.rviz
knorth55 Oct 14, 2022
bd611d6
Add diagnostics_rx_error_summarizer.py
Kanazawanaoaki Oct 15, 2022
bd63e63
disable mongodb and dialogflow in pr2 gazebo
knorth55 Oct 18, 2022
64b398f
add pr2_gazebo_empty_world.launch
knorth55 Oct 18, 2022
3ff0bc6
Changed to show all devices with errors instead of max
Kanazawanaoaki Oct 18, 2022
6855b85
set imu_used false in pr2_bringup.launch because drifting
knorth55 Oct 19, 2022
bc900c3
change smach_to_mail rospara load
Oct 20, 2022
6f23659
smach_to_mail remap smach topic
knorth55 Oct 21, 2022
3cc8132
change node name to smach_to_mail
knorth55 Oct 21, 2022
0b1aa09
[jsk_robot_startup] Add timeout for smach notification
tkmtnt7000 Oct 11, 2022
e141259
[jsk_robot_startup] Fix sending notification every times if demo stuck
tkmtnt7000 Oct 13, 2022
aa68f94
[jsk_robot_startup] Refactor _stop_timer_cb
tkmtnt7000 Oct 13, 2022
4a036b0
[jsk_robot_startup] Add docstring to _stop_timer_cb
tkmtnt7000 Oct 13, 2022
47ba8ee
use latest smach_viewer
Oct 22, 2022
e85fe17
use pr2_mechanism_controllers 1.10.18
iory Nov 10, 2022
a438e71
update rosinstall to use jsk_pr2eus origin/master
knorth55 Nov 21, 2022
dd4ee88
Add nodes to adjust the volume of the speaking
Kanazawanaoaki Nov 3, 2022
8083cc3
Add volume adjust apps
Kanazawanaoaki Nov 13, 2022
8e85e5e
use enable and speak_enable for volume control
knorth55 Dec 5, 2022
b624679
launch app_scheduler in pr2.launch
knorth55 Dec 5, 2022
51eb96f
ad volume key in tweet-string func
knorth55 Nov 11, 2022
0c43b46
control volume by dynamic reconfigure
knorth55 Nov 11, 2022
87367ab
add enable and speak-enable dynamic reconfigure
knorth55 Nov 18, 2022
06ee694
camera sound only when speak is t
knorth55 Nov 18, 2022
47b15a0
set volume for play-sound
knorth55 Nov 18, 2022
3f9bc26
[jsk_robot_startup] Fix variable name; *speak* -> *speak-enable*
tkmtnt7000 Dec 2, 2022
810d0e1
[jsk_robot_startup/lifelog] Tweet randomly from uptime
tkmtnt7000 Jun 7, 2023
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: 7 additions & 41 deletions jsk_fetch_robot/jsk_fetch_startup/scripts/update_workspace.sh
Original file line number Diff line number Diff line change
@@ -1,43 +1,9 @@
#!/usr/bin/env bash

. $HOME/ros/melodic/devel/setup.bash
# Filename should end with .txt to preview the contents in a web browser
LOGFILE=$HOME/ros/melodic/update_workspace.txt

{
set -x
# Update workspace
cd $HOME/ros/melodic/src
ln -sf $(rospack find jsk_fetch_startup)/../jsk_fetch.rosinstall.$ROS_DISTRO $HOME/ros/melodic/src/.rosinstall
wstool foreach --git 'git stash'
wstool update --delete-changed-uris
WSTOOL_UPDATE_RESULT=$?
cd $HOME/ros/melodic
catkin clean aques_talk collada_urdf_jsk_patch -y
catkin init
catkin config -DCMAKE_BUILD_TYPE=Release
catkin build
CATKIN_BUILD_RESULT=$?
# Send mail
MAIL_BODY=""
if [ $WSTOOL_UPDATE_RESULT -ne 0 ]; then
MAIL_BODY=$MAIL_BODY"Please wstool update workspace manually. "
fi
if [ $CATKIN_BUILD_RESULT -ne 0 ]; then
MAIL_BODY=$MAIL_BODY"Please catkin build workspace manually."
fi
set +x
} > $LOGFILE 2>&1
if [ -n "$MAIL_BODY" ]; then
rostopic pub -1 /email jsk_robot_startup/Email "header:
seq: 0
stamp: {secs: 0, nsecs: 0}
frame_id: ''
subject: 'Daily workspace update fails'
body: '$MAIL_BODY'
sender_address: '$(hostname)@jsk.imi.i.u-tokyo.ac.jp'
receiver_address: '[email protected]'
smtp_server: ''
smtp_port: ''
attached_files: ['$LOGFILE']"
fi
cp $(rospack find jsk_robot_startup)/scripts/update_workspace_main.sh /tmp/update_workspace.sh
# jsk_footstep_planner is not released for melodic
# jsk_footstep_controller is not released for melodic
# librealsense2 should not be installed from ROS repository
# realsense-ros should not be installed from ROS repository
/tmp/update_workspace.sh -r $(rospack find jsk_fetch_startup)/../jsk_fetch.rosinstall.$ROS_DISTRO -t fetch -s "jsk_footstep_controller jsk_footstep_planner librealsense2 realsense2_camera realsense2_description"
rm /tmp/update_workspace.sh
3 changes: 2 additions & 1 deletion jsk_pr2_robot/jsk_pr2_startup/apps/tweet/tweet.app
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
display: PR2 Tweet
description: PR2 likes tweeting
platform: pr2
launch: jsk_pr2_startup/tweet.xml
# launch: jsk_pr2_startup/tweet.xml
run: jsk_pr2_startup/tweet.l
interface: jsk_pr2_startup/tweet.interface
icon: jsk_pr2_startup/tweet.png
Empty file modified jsk_pr2_robot/jsk_pr2_startup/apps/tweet/tweet.l
100644 → 100755
Empty file.
35 changes: 27 additions & 8 deletions jsk_pr2_robot/jsk_pr2_startup/config/jsk_startup.rviz
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ Panels:
Property Tree Widget:
Expanded:
- /Diagnostics1/Power1
- /Vision1/NarrowStereoLeft1
- /Planning1/SmachImage1
Splitter Ratio: 0.557554007
Tree Height: 1855
- Class: rviz/Selection
Expand Down Expand Up @@ -899,9 +901,9 @@ Visualization Manager:
Enabled: false
Invert Rainbow: false
Max Color: 255; 255; 255
Max Intensity: 1.08762002
Max Intensity: 4096
Min Color: 0; 0; 0
Min Intensity: 0.190980002
Min Intensity: 0
Name: TiltScan
Position Transformer: XYZ
Queue Size: 10
Expand Down Expand Up @@ -976,6 +978,23 @@ Visualization Manager:
Value: true
Enabled: true
Name: Vision
- Class: rviz/Group
Displays:
- Class: jsk_rviz_plugin/OverlayImage
Enabled: true
Name: SmachImage
Topic: /smach_image_publisher/image
Value: true
alpha: 0.850000024
height: 200
keep aspect ratio: true
left: 2700
overwrite alpha value: false
top: 50
transport hint: compressed
width: 600
Enabled: true
Name: Planning
Enabled: true
Global Options:
Background Color: 48; 48; 48
Expand Down Expand Up @@ -1003,25 +1022,25 @@ Visualization Manager:
Views:
Current:
Class: rviz/Orbit
Distance: 10.3789015
Distance: 8.56335258
Enable Stereo Rendering:
Stereo Eye Separation: 0.0599999987
Stereo Focal Distance: 1
Swap Stereo Eyes: false
Value: false
Focal Point:
X: 1.27238953
Y: -0.646221399
Z: 1.45365202
X: 1.20282674
Y: 0.220421076
Z: 1.34202754
Focal Shape Fixed Size: true
Focal Shape Size: 0.0500000007
Invert Z Axis: false
Name: Current View
Near Clip Distance: 0.00999999978
Pitch: 0.449796855
Pitch: 0.429796875
Target Frame: base_link
Value: Orbit (rviz)
Yaw: 0.113857321
Yaw: 0.71885699
Saved: ~
Window Geometry:
Displays:
Expand Down
23 changes: 23 additions & 0 deletions jsk_pr2_robot/jsk_pr2_startup/config/pr2_app_schedule.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# check use_sim_time
- name: check_use_sim_time
app_name: jsk_robot_startup/check_use_sim_time
app_schedule:
start: every().hour.at(":00")
# volume for monday
- name: volume_zero_monday
app_name: jsk_robot_startup/volume_zero
app_schedule:
start: every().monday.at("12:00")
- name: volume_reset_monday
app_name: jsk_robot_startup/volume_reset
app_schedule:
start: every().monday.at("16:00")
# volume for tuesday
- name: volume_zero_tuesday
app_name: jsk_robot_startup/volume_zero
app_schedule:
start: every().tuesday.at("12:00")
- name: volume_reset_tuesday
app_name: jsk_robot_startup/volume_reset
app_schedule:
start: every().tuesday.at("16:00")
11 changes: 8 additions & 3 deletions jsk_pr2_robot/jsk_pr2_startup/jsk_pr2.rosinstall
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
- git:
local-name: PR2/pr2_controllers
uri: https://github.com/PR2/pr2_controllers.git
version: melodic-devel
version: 1.10.18
# we need to install from source because pr2 is indigo
- git:
local-name: PR2/pr2_self_test
Expand Down Expand Up @@ -85,8 +85,8 @@
# we need this for eus10 and roseus_resume
- git:
local-name: jsk-ros-pkg/jsk_pr2eus
uri: https://github.com/knorth55/jsk_pr2eus.git
version: pr1040
uri: https://github.com/jsk-ros-pkg/jsk_pr2eus.git
version: master
# we need to install from source because pr2 is indigo
- git:
local-name: jsk-ros-pkg/jsk_recognition
Expand Down Expand Up @@ -143,6 +143,11 @@
uri: https://github.com/ros-gbp/common_msgs-release/archive/release/kinetic/visualization_msgs/1.12.7-0.tar.gz
version: common_msgs-release-release-kinetic-visualization_msgs-1.12.7-0
# we need to install from source because pr2 is indigo
- git:
local-name: ros-visualization/executive_smach_visualization
uri: https://github.com/ros-visualization/executive_smach_visualization.git
version: melodic-devel
# we need to install from source because pr2 is indigo
- git:
local-name: ros-visualization/interactive_markers
uri: https://github.com/ros-visualization/interactive_markers.git
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

<include file="$(find jsk_robot_startup)/lifelog/tweet.launch">
<arg name="robot_name" value="PR2"/>
<arg name="image_topics" default="/edgetpu_human_pose_estimator/output/image" />

<arg name="machine" value="c2"/>
<arg name="output" value="screen"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def restart_openni_node(self):

def run(self):
while not rospy.is_shutdown():
if self.image_sub == None or self.image_sub.impl == None:
if self.image_sub is None or self.image_sub.impl is None:
self.image_sub = rospy.Subscriber("image", Image, self.image_callback, None, 1)
rospy.sleep(self.sleep_cycle)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,9 @@
<group if="$(arg respawn)">
<node pkg="jsk_pr2_startup" name="check_openni_node" type="check_openni_node.py"
output="screen" machine="c1" if="$(arg monitor_driver)">
<remap from="image" to="/$(arg camera)/rgb/image_raw" />
<param name="camera" value="$(arg camera)" />
<param name="sleep_cycle" value="60" />
<remap from="image" to="/$(arg camera)/rgb/image_rect_color" />
</node>
</group>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,13 @@ def write(self, date, info):
rospy.logerr("{}".format(e))
rospy.logerr("Could not write to dweet.io")
return
assert res.ok and json.loads(res.content)["this"] == "succeeded"
try:
contents = json.loads(res.content)
except ValueError as e:
rospy.logerr("{}".format(e))
rospy.logerr("Request successed, but return value is invalid.")
return
assert res.ok and contents["this"] == "succeeded"


class BatteryInfoAggregator(object):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env python

import rospy

from diagnostic_msgs.msg import DiagnosticArray


def callback(data):
flag = False
for e in data.status:
#EtherCAT Device
for v in e.values:
if v.key =='Drops':
flag = True
print(e.name + "Drops: {}".format(v.value))
#EtherCAT Master
if e.name == 'EtherCAT Master':
for v in e.values:
if v.key =='Dropped Packets':
print(e.name + " Dropped Packets: {}".format(v.value))
if v.key =='RX Late Packet':
print(e.name + " RX Late Packet: {}".format(v.value))

if flag:
print("--------------------------------------------")


def listener():
rospy.init_node('diagnostics_ethercat_summarizer', anonymous=True)
rospy.Subscriber('/diagnostics', DiagnosticArray, callback)
rospy.spin()

if __name__ == '__main__':
listener()
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
#!/usr/bin/env python

import csv
import rospy
import argparse
from diagnostic_msgs.msg import DiagnosticArray


class DiagnosticsRxErrorSummarizer():
def __init__(self, is_csv=False):
self.subscribe()
self.keys = ['timestamp']
self.count = 0
self.output_file = 'diagnostic_agg_rx_error.csv'
self.is_csv = is_csv

def subscribe(self):
self.sub = rospy.Subscriber("/diagnostics_agg",
DiagnosticArray,
self.callback,
queue_size=1)

def write_keys(self):
with open(self.output_file, 'w') as f:
writer = csv.writer(f)
writer.writerow(self.keys)

def write_values(self):
with open(self.output_file, 'a') as f:
writer = csv.writer(f)
writer.writerow(self.values)

def callback(self, msg):
status = msg.status
self.values = [msg.header.stamp.secs]
if self.is_csv:
print(self.count)
for s in status:
if 'values' not in dir(s):
continue
for v in s.values:
if 'RX Error' in v.key:
if self.count == 0:
self.keys.append(s.name + ' - ' + v.key)
self.values.append(v.value)

if self.count == 0:
self.write_keys()
self.write_values()

self.count += 1
else:
flag = False
thre_val = 0
s_name_list = []
key_list = []
value_list = []
for s in status:
if 'values' not in dir(s):
continue
for v in s.values:
if 'RX Error' in v.key and not ('Forwarded' in v.key):
print(s.name + " " + v.key + ": {}".format(v.value))
if not ('Master' in s.name):
flag = True
if int(v.value) > thre_val:
s_name_list.append(s.name)
value_list.append(v.value)
key_list.append(v.key)

if flag:
if len(s_name_list) > 0:
print("[Eroor Exist Dvice]")
for s_name, key, value in zip(s_name_list, key_list, value_list):
print(s_name + " " + key + ": {}".format(value))
print("--------------------------------------------")


if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--csv', action='store_true', help='save data in csv or not')
args = parser.parse_args()
is_csv= args.csv

rospy.init_node('diagnostics_rx_errror_summarizer', anonymous=True)
diagnostics_rx_errror_summarizer = DiagnosticsRxErrorSummarizer(is_csv=is_csv)
rospy.spin()
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ analyzers:
joystick:
type: diagnostic_aggregator/GenericAnalyzer
path: Joystick
expected: 'joy: Joystick Driver Status'
expected: 'joy_node: Joystick Driver Status'
num_items: 1
remove_prefix: 'joy'
remove_prefix: 'joy_node'
sound:
type: diagnostic_aggregator/GenericAnalyzer
path: Sound
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
topics:
- /kinect_head/rgb/image_raw/compressed
- /kinect_head/depth_registered/image_raw/compressedDepth
- /edgetpu_human_pose_estimator/output/image/compressed
- /edgetpu_object_detector/output/image/compressed
- /audio
Loading