Skip to content

Commit

Permalink
Merge pull request #438 from kindsenior/noetic
Browse files Browse the repository at this point in the history
Noetic in Nov before Day3
  • Loading branch information
kindsenior authored Nov 16, 2023
2 parents 85246a8 + f786681 commit 0e505c8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .rosinstall.noetic
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions mechatrobot/launch/sample_face_detect.launch
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
<include file="$(find opencv_apps)/launch/face_detection.launch">
<arg name="image" value="/usb_cam/image_raw"/>
<arg name="debug_view" value="$(arg debug_view)"/>
<!-- maybe it is correct to setting use_opencv4 arg but it does not work in face_detection.launch -->
<arg name="face_cascade_name" value="/usr/share/opencv4/haarcascades/haarcascade_frontalface_alt.xml" />
<arg name="eyes_cascade_name" value="/usr/share/opencv4/haarcascades/haarcascade_eye_tree_eyeglasses.xml" />
</include>

</launch>
8 changes: 4 additions & 4 deletions mechatrobot/scripts/motor-command-by-face.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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():
Expand Down

0 comments on commit 0e505c8

Please sign in to comment.