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

Noetic in Nov before Day3 #438

Merged
merged 3 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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