From 105c8de886f715ba032c9714a1de971a393785c7 Mon Sep 17 00:00:00 2001 From: kindsenior Date: Fri, 17 Nov 2023 03:38:26 +0900 Subject: [PATCH 1/3] [mechatrobot/scripts] support python3 --- mechatrobot/scripts/motor-command-by-face.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mechatrobot/scripts/motor-command-by-face.py b/mechatrobot/scripts/motor-command-by-face.py index 5421c44..f5c3f90 100755 --- a/mechatrobot/scripts/motor-command-by-face.py +++ b/mechatrobot/scripts/motor-command-by-face.py @@ -5,7 +5,7 @@ from std_msgs.msg import Int64 image_size = [640, 480] # pixel -image_center = list(map(lambda x: x/2, image_size)) +image_center = list([x/2 for x in image_size]) motor_angle = 0 # [deg] def face_detection_cb(msg): @@ -29,13 +29,13 @@ def face_detection_cb(msg): motor_command_msg.data = motor_angle # print - print "face_pos(x, y): ({} {})".format(face_pos[0], face_pos[1]) - print "/motor1/command: {}\n".format(motor_command_msg.data) + print("face_pos(x, y): ({} {})".format(face_pos[0], face_pos[1])) + print("/motor1/command: {}\n".format(motor_command_msg.data)) # publish pub.publish(motor_command_msg) else: - print "no faces" + print("no faces") def main(): From ef6a1d34c2ef62135343d1fac565347db18bdf9d Mon Sep 17 00:00:00 2001 From: kindsenior Date: Fri, 17 Nov 2023 03:35:49 +0900 Subject: [PATCH 2/3] [.rosinstall.noetic] temporarily revert ros_controllers for publishing /motor1/position in mechatrobot --- .rosinstall.noetic | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.rosinstall.noetic b/.rosinstall.noetic index d58e37b..c51cd45 100644 --- a/.rosinstall.noetic +++ b/.rosinstall.noetic @@ -74,3 +74,7 @@ # uri: https://github.com/jsk-ros-pkg/jsk_roseus.git uri: https://github.com/k-okada/jsk_roseus.git version: set-log-level-to-error +- git: + local-name: ros_controllers + uri: https://github.com/ros-controls/ros_controllers.git + version: 0.20.0 # after this version, ros_control does not publish /motor1/position based on /position_trajectory_controller/command from /rqt_joint_trajectory_controller because of the same warning https://github.com/ros-controls/ros_controllers/issues/291 \ No newline at end of file From f7866815226e91a02c8db47e6b7d1b8e15de9a1e Mon Sep 17 00:00:00 2001 From: kindsenior Date: Fri, 17 Nov 2023 03:36:46 +0900 Subject: [PATCH 3/3] [mechatrobot/launch] temporarily set args because use_opencv4 arg does not work in face_detection.launch of opencv_apps --- mechatrobot/launch/sample_face_detect.launch | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mechatrobot/launch/sample_face_detect.launch b/mechatrobot/launch/sample_face_detect.launch index 26f8889..98f8fee 100644 --- a/mechatrobot/launch/sample_face_detect.launch +++ b/mechatrobot/launch/sample_face_detect.launch @@ -10,6 +10,9 @@ + + +