Skip to content

Commit

Permalink
[spot_ros_client] add print
Browse files Browse the repository at this point in the history
  • Loading branch information
sktometometo committed Nov 28, 2023
1 parent 7f5c2c6 commit 4be14b8
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 4 deletions.
30 changes: 30 additions & 0 deletions jsk_spot_robot/spot_ros_client/.vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"configurations": [
{
"browse": {
"databaseFilename": "${default}",
"limitSymbolsToIncludedHeaders": false
},
"includePath": [
"/home/sktometometo/ros/ws_jsk_spot/devel/include/**",
"/opt/ros/noetic/include/**",
"/home/sktometometo/ros/ws_jsk_spot/src/jsk-ros-pkg/jsk_robot/jsk_robot_common/jsk_robot_startup/include/**",
"/opt/ros/noetic/share/julius/include/**",
"/home/sktometometo/ros/ws_jsk_spot/src/jsk-ros-pkg/jsk_robot/jsk_pr2_robot/pr2_base_trajectory_action/include/**",
"/home/sktometometo/ros/ws_jsk_spot/src/jsk-ros-pkg/jsk_robot/jsk_robot_common/speak_and_wait_recovery/include/**",
"/home/sktometometo/ros/ws_jsk_spot/src/ublox/ublox_gps/include/**",
"/home/sktometometo/ros/ws_jsk_spot/src/ublox/ublox_msg_filters/include/**",
"/home/sktometometo/ros/ws_jsk_spot/src/ublox/ublox_msgs/include/**",
"/home/sktometometo/ros/ws_jsk_spot/src/ublox/ublox_serialization/include/**",
"/home/sktometometo/ros/ws_jsk_spot/src/jsk-ros-pkg/jsk_robot/jsk_robot_common/update_move_base_parameter_recovery/include/**",
"/usr/include/**"
],
"name": "ROS",
"intelliSenseMode": "gcc-x64",
"compilerPath": "/usr/bin/gcc",
"cStandard": "gnu11",
"cppStandard": "c++14"
}
],
"version": 4
}
10 changes: 10 additions & 0 deletions jsk_spot_robot/spot_ros_client/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"python.autoComplete.extraPaths": [
"/home/sktometometo/ros/ws_jsk_spot/devel/lib/python3/dist-packages",
"/opt/ros/noetic/lib/python3/dist-packages"
],
"python.analysis.extraPaths": [
"/home/sktometometo/ros/ws_jsk_spot/devel/lib/python3/dist-packages",
"/opt/ros/noetic/lib/python3/dist-packages"
]
}
17 changes: 13 additions & 4 deletions jsk_spot_robot/spot_ros_client/src/spot_ros_client/libspotros.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,10 @@ def __init__(self,
Pose,
queue_size=1
)
rospy.loginfo("Publisher initialization done.")

# wait for services
rospy.loginfo("Waiting all service available...")
try:
rospy.wait_for_service(servicename_claim, rospy.Duration(5))
rospy.wait_for_service(servicename_release, rospy.Duration(5))
Expand Down Expand Up @@ -268,6 +270,8 @@ def __init__(self,
ResetCurrentNode
)

rospy.loginfo("Service initialization done.")

# Action Clients
self._actionclient_navigate_to = actionlib.SimpleActionClient(
actionname_navigate_to,
Expand All @@ -282,10 +286,7 @@ def __init__(self,
NavigationAction
)

#
self.tf_buffer = tf2_ros.Buffer()
self.tf_listener = tf2_ros.TransformListener(self.tf_buffer)

rospy.loginfo("Waiting actions available")
# wait for action
try:
self._actionclient_navigate_to.wait_for_server(rospy.Duration(5))
Expand All @@ -295,6 +296,14 @@ def __init__(self,
except rospy.ROSException as e:
rospy.logerr('Action unavaliable: {}'.format(e))

#
self.tf_buffer = tf2_ros.Buffer()
self.tf_listener = tf2_ros.TransformListener(self.tf_buffer)

rospy.loginfo("Action initialization done.")

rospy.loginfo("Initialization done")

def get_laptop_percepntage(self):
try:
msg = rospy.wait_for_message(
Expand Down

0 comments on commit 4be14b8

Please sign in to comment.