├── .gitignore ├── README.md ├── day1 ├── IRACV-IO-setup └── opencvFeedLoading.py ├── day2 ├── cards.jpg ├── taskResources │ ├── lineFollower.py │ ├── shapeClassifier.py │ ├── shapes.JPG │ └── test.mp4 ├── transforms.py └── warpPerspective.py ├── day3 ├── ROS instructions.odt ├── listener.py ├── talker.py ├── temp.txt ├── turtlesim_cleaner.py └── turtlesim_move.py ├── day4 ├── README.md ├── ros_package_template │ ├── CMakeLists.txt │ ├── LICENSE │ ├── README.md │ ├── config │ │ └── default.yaml │ ├── doc │ │ └── example.jpg │ ├── include │ │ └── ros_package_template │ │ │ ├── Algorithm.hpp │ │ │ └── RosPackageTemplate.hpp │ ├── launch │ │ ├── ros_package_template.launch │ │ └── ros_package_template_overlying_params.launch │ ├── package.xml │ ├── src │ │ ├── Algorithm.cpp │ │ ├── RosPackageTemplate.cpp │ │ └── ros_package_template_node.cpp │ └── test │ │ ├── AlgorithmTest.cpp │ │ └── test_ros_package_template.cpp └── temp.txt ├── day5 ├── geographic_info │ ├── README.rst │ ├── geodesy │ │ ├── CHANGELOG.rst │ │ ├── CMakeLists.txt │ │ ├── doc │ │ │ ├── conf.py │ │ │ ├── geodesy.bounding_box.rst │ │ │ ├── geodesy.gen_uuid.rst │ │ │ ├── geodesy.props.rst │ │ │ ├── geodesy.utm.rst │ │ │ ├── geodesy.wu_point.rst │ │ │ └── index.rst │ │ ├── include │ │ │ └── geodesy │ │ │ │ ├── utm.h │ │ │ │ └── wgs84.h │ │ ├── mainpage.dox │ │ ├── package.xml │ │ ├── rosdoc.yaml │ │ ├── setup.py │ │ ├── src │ │ │ ├── conv │ │ │ │ └── utm_conversions.cpp │ │ │ └── geodesy │ │ │ │ ├── __init__.py │ │ │ │ ├── bounding_box.py │ │ │ │ ├── props.py │ │ │ │ ├── utm.py │ │ │ │ └── wu_point.py │ │ └── tests │ │ │ ├── test_bounding_box.py │ │ │ ├── test_props.py │ │ │ ├── test_utm.cpp │ │ │ ├── test_utm.py │ │ │ ├── test_wgs84.cpp │ │ │ └── test_wu_point.py │ ├── geographic_info │ │ ├── CHANGELOG.rst │ │ ├── CMakeLists.txt │ │ └── package.xml │ └── geographic_msgs │ │ ├── CHANGELOG.rst │ │ ├── CMakeLists.txt │ │ ├── mainpage.dox │ │ ├── msg │ │ ├── BoundingBox.msg │ │ ├── GeoPath.msg │ │ ├── GeoPoint.msg │ │ ├── GeoPointStamped.msg │ │ ├── GeoPose.msg │ │ ├── GeoPoseStamped.msg │ │ ├── GeoPoseWithCovariance.msg │ │ ├── GeoPoseWithCovarianceStamped.msg │ │ ├── GeographicMap.msg │ │ ├── GeographicMapChanges.msg │ │ ├── KeyValue.msg │ │ ├── MapFeature.msg │ │ ├── RouteNetwork.msg │ │ ├── RoutePath.msg │ │ ├── RouteSegment.msg │ │ └── WayPoint.msg │ │ ├── package.xml │ │ └── srv │ │ ├── GetGeoPath.srv │ │ ├── GetGeographicMap.srv │ │ ├── GetRoutePlan.srv │ │ └── UpdateGeographicMap.srv ├── temp.txt └── unique_identifier │ ├── README.rst │ ├── unique_id │ ├── CHANGELOG.rst │ ├── CMakeLists.txt │ ├── conf.py │ ├── include │ │ └── unique_id │ │ │ ├── impl │ │ │ └── unique_id.h │ │ │ └── unique_id.h │ ├── index.rst │ ├── mainpage.dox │ ├── package.xml │ ├── rosdoc.yaml │ ├── setup.py │ ├── src │ │ └── unique_id │ │ │ └── __init__.py │ ├── tests │ │ ├── CMakeLists.txt │ │ ├── second_test_unique_id.cpp │ │ ├── test_unique_id.cpp │ │ └── test_unique_id.py │ └── unique_id.rst │ ├── unique_identifier │ ├── CHANGELOG.rst │ ├── CMakeLists.txt │ └── package.xml │ └── uuid_msgs │ ├── CHANGELOG.rst │ ├── CMakeLists.txt │ ├── mainpage.dox │ ├── msg │ └── UniqueID.msg │ └── package.xml ├── day6 ├── ISSUE_TEMPLATE.md ├── LICENSE ├── README.md ├── bicepCurl.py ├── fingerCount.py ├── hector_control.py ├── out.png ├── quaternionFromPose.py ├── turtlebot3 │ ├── CHANGELOG.rst │ ├── CMakeLists.txt │ └── package.xml ├── turtlebot3_bringup │ ├── 99-turtlebot3-cdc.rules │ ├── CHANGELOG.rst │ ├── CMakeLists.txt │ ├── camera_info │ │ └── turtlebot3_rpicamera.yaml │ ├── launch │ │ ├── includes │ │ │ └── description.launch.xml │ │ ├── turtlebot3_core.launch │ │ ├── turtlebot3_lidar.launch │ │ ├── turtlebot3_model.launch │ │ ├── turtlebot3_realsense.launch │ │ ├── turtlebot3_remote.launch │ │ ├── turtlebot3_robot.launch │ │ └── turtlebot3_rpicamera.launch │ ├── package.xml │ ├── scripts │ │ └── create_udev_rules │ └── src │ │ └── turtlebot3_diagnostics.cpp ├── turtlebot3_description │ ├── CMakeLists.txt │ ├── meshes │ │ ├── sensors │ │ │ ├── astra.dae │ │ │ ├── astra.jpg │ │ │ ├── lds.stl │ │ │ ├── r200.dae │ │ │ └── r200.jpg │ │ └── wheels │ │ │ ├── left_tire.stl │ │ │ └── right_tire.stl │ ├── rviz │ │ ├── burger.rviz │ │ └── waffle_pi.rviz │ └── urdf │ │ ├── common_properties.xacro │ │ ├── turtlebot3_burger.gazebo.xacro │ │ ├── turtlebot3_burger.urdf.xacro │ │ ├── turtlebot3_burger_for_autorace.gazebo.xacro │ │ ├── turtlebot3_burger_for_autorace.urdf.xacro │ │ ├── turtlebot3_burger_for_autorace_2020.gazebo.xacro │ │ ├── turtlebot3_burger_for_autorace_2020.urdf.xacro │ │ ├── turtlebot3_waffle.gazebo.xacro │ │ ├── turtlebot3_waffle.urdf.xacro │ │ ├── turtlebot3_waffle_for_open_manipulator.urdf.xacro │ │ ├── turtlebot3_waffle_pi.gazebo.xacro │ │ ├── turtlebot3_waffle_pi.urdf.xacro │ │ ├── turtlebot3_waffle_pi_for_open_manipulator.gazebo.xacro │ │ └── turtlebot3_waffle_pi_for_open_manipulator.urdf.xacro ├── turtlebot3_example │ ├── CHANGELOG.rst │ ├── CMakeLists.txt │ ├── action │ │ └── Turtlebot3.action │ ├── launch │ │ ├── interactive_markers.launch │ │ ├── turtlebot3_bumper.launch │ │ ├── turtlebot3_client.launch │ │ ├── turtlebot3_cliff.launch │ │ ├── turtlebot3_illumination.launch │ │ ├── turtlebot3_obstacle.launch │ │ ├── turtlebot3_pointop_key.launch │ │ └── turtlebot3_sonar.launch │ ├── nodes │ │ ├── turtlebot3_bumper │ │ ├── turtlebot3_client │ │ ├── turtlebot3_cliff │ │ ├── turtlebot3_illumination │ │ ├── turtlebot3_marker_server │ │ ├── turtlebot3_obstacle │ │ ├── turtlebot3_pointop_key │ │ ├── turtlebot3_server │ │ └── turtlebot3_sonar │ ├── package.xml │ ├── rviz │ │ └── turtlebot3_interactive.rviz │ ├── setup.py │ └── src │ │ └── turtlebot3_example │ │ └── __init__.py ├── turtlebot3_navigation │ ├── CHANGELOG.rst │ ├── CMakeLists.txt │ ├── launch │ │ ├── amcl.launch │ │ ├── move_base.launch │ │ └── turtlebot3_navigation.launch │ ├── maps │ │ ├── map.pgm │ │ └── map.yaml │ ├── package.xml │ ├── param │ │ ├── base_local_planner_params.yaml │ │ ├── costmap_common_params_burger.yaml │ │ ├── costmap_common_params_waffle.yaml │ │ ├── costmap_common_params_waffle_pi.yaml │ │ ├── dwa_local_planner_params_burger.yaml │ │ ├── dwa_local_planner_params_waffle.yaml │ │ ├── dwa_local_planner_params_waffle_pi.yaml │ │ ├── global_costmap_params.yaml │ │ ├── local_costmap_params.yaml │ │ └── move_base_params.yaml │ └── rviz │ │ └── turtlebot3_navigation.rviz ├── turtlebot3_slam │ ├── CHANGELOG.rst │ ├── CMakeLists.txt │ ├── bag │ │ └── bag_files.md │ ├── config │ │ ├── frontier_exploration.yaml │ │ ├── gmapping_params.yaml │ │ ├── karto_mapper_params.yaml │ │ ├── turtlebot3_lds_2d.lua │ │ └── turtlebot3_lds_2d_gazebo.lua │ ├── include │ │ └── turtlebot3_slam │ │ │ └── flat_world_imu_node.h │ ├── launch │ │ ├── turtlebot3_cartographer.launch │ │ ├── turtlebot3_frontier_exploration.launch │ │ ├── turtlebot3_gmapping.launch │ │ ├── turtlebot3_hector.launch │ │ ├── turtlebot3_karto.launch │ │ ├── turtlebot3_manipulation_slam.launch │ │ └── turtlebot3_slam.launch │ ├── package.xml │ ├── rviz │ │ ├── turtlebot3_cartographer.rviz │ │ ├── turtlebot3_frontier_exploration.rviz │ │ ├── turtlebot3_gmapping.rviz │ │ ├── turtlebot3_hector.rviz │ │ └── turtlebot3_karto.rviz │ └── src │ │ └── flat_world_imu_node.cpp └── turtlebot3_teleop │ ├── CHANGELOG.rst │ ├── CMakeLists.txt │ ├── launch │ └── turtlebot3_teleop_key.launch │ ├── nodes │ └── turtlebot3_teleop_key │ ├── package.xml │ ├── setup.py │ └── src │ └── turtlebot3_teleop │ └── __init__.py ├── day7 ├── IO_Assignment Instructions ├── hectorCVBridge.py ├── listener.py ├── talker.py └── turtlesim_cleaner.py └── resources ├── PESU I_O Slot 14 Applied Computer Vision & Robotics Course Plan.pdf ├── ROSResources ├── 2018-08-13-16-42-15.bag ├── Image Structure.ipynb ├── Image_Encoding.ipynb ├── action_client.py ├── action_server.py ├── add_client.py ├── add_server.py ├── ball_detection.py ├── ball_tracking.py ├── color_filtering.py ├── contours_detection.py ├── contours_processing.py ├── depth_image_to_laser.launch ├── hector_gazebo │ ├── CHANGELOG.rst │ ├── CMakeLists.txt │ └── package.xml ├── hector_gazebo_plugins │ ├── CHANGELOG.rst │ ├── CMakeLists.txt │ ├── cfg │ │ ├── GNSS.cfg │ │ └── SensorModel.cfg │ ├── include │ │ └── hector_gazebo_plugins │ │ │ ├── diffdrive_plugin_6w.h │ │ │ ├── diffdrive_plugin_multi_wheel.h │ │ │ ├── gazebo_ros_force_based_move.h │ │ │ ├── gazebo_ros_gps.h │ │ │ ├── gazebo_ros_imu.h │ │ │ ├── gazebo_ros_magnetic.h │ │ │ ├── gazebo_ros_sonar.h │ │ │ ├── reset_plugin.h │ │ │ ├── sensor_model.h │ │ │ ├── servo_plugin.h │ │ │ └── update_timer.h │ ├── package.xml │ ├── src │ │ ├── diffdrive_plugin_6w.cpp │ │ ├── diffdrive_plugin_multi_wheel.cpp │ │ ├── gazebo_ros_force_based_move.cpp │ │ ├── gazebo_ros_gps.cpp │ │ ├── gazebo_ros_imu.cpp │ │ ├── gazebo_ros_magnetic.cpp │ │ ├── gazebo_ros_sonar.cpp │ │ ├── reset_plugin.cpp │ │ └── servo_plugin.cpp │ └── srv │ │ └── SetBias.srv ├── hector_gazebo_thermal_camera │ ├── CHANGELOG.rst │ ├── CMakeLists.txt │ ├── include │ │ └── hector_gazebo_thermal_camera │ │ │ └── gazebo_ros_thermal_camera.h │ ├── package.xml │ └── src │ │ ├── gazebo_ros_thermal_camera.cpp │ │ ├── gazebo_ros_thermal_camera_plugin.cpp │ │ └── gazebo_ros_thermal_depth_camera_plugin.cpp ├── hector_gazebo_worlds │ ├── CMakeLists.txt │ └── Media │ │ └── models │ │ ├── 120m_landscape_smooth_tri.dae │ │ ├── drc_qual4_block.stl │ │ ├── sick_robot_day_2014_inner_block.stl │ │ ├── sick_robot_day_2014_inner_block_with_stations.dae │ │ ├── sick_robot_day_2014_ring.dae │ │ ├── sick_robot_day_2014_target.stl │ │ ├── sick_robot_day_2014_target_station_complete_1.dae │ │ ├── sick_robot_day_2014_target_station_complete_2.dae │ │ ├── sick_robot_day_2014_target_station_complete_4.dae │ │ ├── sick_robot_day_2014_target_station_complete_6.dae │ │ ├── sick_robot_day_2014_target_station_complete_8.dae │ │ ├── sick_robot_day_2014_with_stations.dae │ │ ├── sick_robot_panel.stl │ │ ├── sick_robot_panel_0.dae │ │ ├── sick_robot_panel_0.png │ │ ├── sick_robot_panel_1.png │ │ ├── sick_robot_panel_2.png │ │ ├── sick_robot_panel_3.dae │ │ ├── sick_robot_panel_3.png │ │ ├── sick_robot_panel_4.dae │ │ ├── sick_robot_panel_7.dae │ │ ├── sick_robot_panel_7.png │ │ ├── sick_robot_panel_8.dae │ │ └── small_indoor_scenario.dae ├── hector_localization │ ├── README.md │ ├── hector_localization │ │ ├── CHANGELOG.rst │ │ ├── CMakeLists.txt │ │ └── package.xml │ ├── hector_pose_estimation │ │ ├── CHANGELOG.rst │ │ ├── CMakeLists.txt │ │ ├── hector_pose_estimation_nodelets.xml │ │ ├── include │ │ │ └── hector_pose_estimation │ │ │ │ └── pose_estimation_node.h │ │ ├── launch │ │ │ └── hector_pose_estimation.launch │ │ ├── package.xml │ │ ├── rviz_cfg │ │ │ └── hector_pose_estimation.rviz │ │ └── src │ │ │ ├── main.cpp │ │ │ ├── pose_estimation_node.cpp │ │ │ └── pose_estimation_nodelet.cpp │ ├── hector_pose_estimation_core │ │ └── CMakeLists.txt │ └── message_to_tf │ │ ├── CHANGELOG.rst │ │ ├── CMakeLists.txt │ │ ├── package.xml │ │ └── src │ │ └── message_to_tf.cpp ├── hector_models │ ├── README.md │ ├── hector_components_description │ │ ├── CMakeLists.txt │ │ └── urdf │ │ │ ├── checkerboard.urdf.xacro │ │ │ ├── hector_multisensor_head.urdf.xacro │ │ │ ├── spinning_hokuyo_utm30lx.urdf.xacro │ │ │ ├── spinning_lidar_mount.urdf.xacro │ │ │ ├── vision_box_common.gazebo.xacro │ │ │ ├── vision_box_common.urdf.xacro │ │ │ ├── vision_box_common_dimensions.urdf.xacro │ │ │ ├── vision_box_dimensions_hector1.urdf.xacro │ │ │ ├── vision_box_dimensions_hector2.urdf.xacro │ │ │ └── vision_box_hector2_addons.urdf.xacro │ └── hector_models.rosinstall ├── hector_sensors_gazebo │ ├── CHANGELOG.rst │ ├── CMakeLists.txt │ └── package.xml ├── hector_ui │ ├── CMakeLists.txt │ └── src │ │ ├── ui_hector_quad.py │ │ └── ui_hector_quad_follower.py ├── image_channels.py ├── image_draw.py ├── image_encoding.py ├── image_pub_sub.py ├── image_pub_sub_class.py ├── image_structure.py ├── image_thresholding.py ├── iot_sensor_publisher.py ├── iot_sensor_subscriber.py ├── open_copy.py ├── position_hold.py ├── read_video.py ├── robot_stops_obstacle.py ├── scan_subscriber.py ├── tf_scan.launch └── turtlesim_move.py └── graphics ├── JBOP.png ├── adithyaOP.png ├── adithyaOP2.png ├── archanaaOP.png ├── bellCurve.jpg ├── courseCover.jpeg └── varchasvinOP.png /.gitignore: -------------------------------------------------------------------------------- 1 | /push 2 | -------------------------------------------------------------------------------- /day1/opencvFeedLoading.py: -------------------------------------------------------------------------------- 1 | # Reading images, video & webcam feeds 2 | 3 | import cv2 4 | 5 | print('package imported') 6 | 7 | ''' 8 | # Display image 9 | 10 | img = cv2.imread('resources/The Sci-Fi Archive.jpg') 11 | 12 | cv2.imshow('output', img) 13 | cv2.waitKey(0) # 0 - infinite, non zero - number of milliseconds 14 | ''' 15 | 16 | # Play video 17 | 18 | cap = cv2.VideoCapture('resources/gae_ofc.mp4') 19 | 20 | while True : 21 | success, img = cap.read() # , 22 | cv2.imshow('Video', img) 23 | if cv2.waitKey(1) & 0xFF == ord('q'): 24 | break 25 | ''' 26 | 27 | ''' 28 | # Real time webcam feed 29 | 30 | cap = cv2.VideoCapture(0) # 0 - default webcam 31 | cap.set(3, 640) # width 32 | cap.set(4, 480) # height 33 | cap.set(10, 100) # brightness 34 | 35 | while True : 36 | success, img = cap.read() # , 37 | cv2.imshow('Video', img) 38 | if cv2.waitKey(1) & 0xFF == ord('q'): 39 | break 40 | 41 | -------------------------------------------------------------------------------- /day2/cards.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sr42-dev/scaling-spoon/59e86c5f2aba61d4d87731aba5b6b042f7985120/day2/cards.jpg -------------------------------------------------------------------------------- /day2/taskResources/lineFollower.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import cv2 3 | import time 4 | 5 | cap = cv2.VideoCapture('/home/sr42/Projects/scaling-spoon/day2/taskResources/test.mp4') 6 | c1 = 0 7 | linecolor = (100, 215, 255) 8 | lwr_red = np.array([0, 0, 0]) 9 | upper_red = np.array([179, 65, 55]) 10 | width = cap.get(3) 11 | 12 | while True: 13 | ret, frame = cap.read() 14 | if not ret: 15 | _, frame = cap.read() 16 | 17 | frame = frame[:, 0:320] 18 | 19 | hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV) 20 | kernel = np.ones((5, 5), np.uint8) 21 | mask = cv2.inRange(hsv, lwr_red, upper_red) 22 | mask = cv2.dilate(mask, kernel, iterations=1) 23 | res = cv2.bitwise_and(frame, frame, mask=mask) 24 | cnts, _ = cv2.findContours(mask.copy(), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE) 25 | center = None 26 | 27 | if len(cnts) > 0: 28 | c = max(cnts, key=cv2.contourArea) 29 | ((x, y), radius) = cv2.minEnclosingCircle(c) 30 | M = cv2.moments(c) 31 | center = (int(M["m10"] / M["m00"]), int(M["m01"] / M["m00"])) 32 | if radius > 3: 33 | # cv2.circle(frame, (int(x), int(y)), int(radius), (255, 255, 255), 2) 34 | cv2.circle(frame, center, 5, linecolor, -1) 35 | 36 | if (x > 0 and x <= 0.25 * width): 37 | print("Left") 38 | cv2.putText(frame, '<--', (5, 50), cv2.FONT_HERSHEY_COMPLEX, 2, (0, 0, 255), 2, cv2.LINE_AA) 39 | time.sleep(0.01) 40 | 41 | elif (x > 0.25 * width and x <= 0.75 * width): 42 | print('Forward') 43 | cv2.putText(frame, '^', (5, 50), cv2.FONT_HERSHEY_COMPLEX, 2, (0, 0, 255), 2, cv2.LINE_AA) 44 | time.sleep(0.01) 45 | 46 | elif (x > 0.75 * width and x <= width): 47 | print("Right") 48 | cv2.putText(frame, '-->', (5, 50), cv2.FONT_HERSHEY_COMPLEX, 2, (0, 0, 255), 2, cv2.LINE_AA) 49 | time.sleep(0.01) 50 | else: 51 | print("Track Not Visible") 52 | c1 += 1 53 | if (c1 == 5): 54 | print("Backward") 55 | cv2.putText(frame, 'V', (5, 50), cv2.FONT_HERSHEY_COMPLEX, 2, (0, 0, 255), 2, cv2.LINE_AA) 56 | c1 = 0 57 | 58 | cv2.imshow("Frame", frame) 59 | 60 | if cv2.waitKey(1) & 0xFF == ord('q'): 61 | cap.release() 62 | cv2.destroyAllWindows() 63 | break -------------------------------------------------------------------------------- /day2/taskResources/shapes.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sr42-dev/scaling-spoon/59e86c5f2aba61d4d87731aba5b6b042f7985120/day2/taskResources/shapes.JPG -------------------------------------------------------------------------------- /day2/taskResources/test.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sr42-dev/scaling-spoon/59e86c5f2aba61d4d87731aba5b6b042f7985120/day2/taskResources/test.mp4 -------------------------------------------------------------------------------- /day2/warpPerspective.py: -------------------------------------------------------------------------------- 1 | # Warp perspective - bird's eye perspective of images 2 | 3 | import cv2 4 | import numpy as np 5 | 6 | img = cv2.imread('/home/sr42/Projects/scaling-spoon/day2/cards.jpg') 7 | 8 | width, height = 250, 350 9 | pts1 = np.float32([[123, 55],[190, 60],[117, 158],[194, 156]]) # to get an adobe scan like image. Points indicate corner points of original document (random here) 10 | pts2 = np.float32([[0, 0],[width, 0],[0, height],[width, height]]) # points indicate output image coordinates 11 | 12 | matrix = cv2.getPerspectiveTransform(pts1, pts2) 13 | imgOutput = cv2.warpPerspective(img, matrix, (width,height)) 14 | 15 | 16 | cv2.imshow('Image', img) 17 | cv2.imshow('Output', imgOutput) 18 | 19 | cv2.waitKey(0) -------------------------------------------------------------------------------- /day3/ROS instructions.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sr42-dev/scaling-spoon/59e86c5f2aba61d4d87731aba5b6b042f7985120/day3/ROS instructions.odt -------------------------------------------------------------------------------- /day3/listener.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import rospy 3 | from std_msgs.msg import String 4 | 5 | def chatter_callback(message): 6 | #get_caller_id(): Get fully resolved name of local node 7 | rospy.loginfo(rospy.get_caller_id() + "I heard %s", message.data) 8 | 9 | def listener(): 10 | 11 | # In ROS, nodes are uniquely named. If two nodes with the same 12 | # node are launched, the previous one is kicked off. The 13 | # anonymous=True flag means that rospy will choose a unique 14 | # name for our 'listener' node so that multiple listeners can 15 | # run simultaneously. 16 | rospy.init_node('listener', anonymous=True) 17 | 18 | rospy.Subscriber("chatter", String, chatter_callback) 19 | 20 | # spin() simply keeps python from exiting until this node is stopped 21 | rospy.spin() 22 | 23 | if __name__ == '__main__': 24 | listener() 25 | -------------------------------------------------------------------------------- /day3/talker.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # license removed for brevity 3 | import rospy 4 | from std_msgs.msg import String 5 | 6 | def talker(): 7 | #create a new publisher. we specify the topic name, then type of message then the queue size 8 | pub = rospy.Publisher('chatter', String, queue_size=10) 9 | #we need to initialize the node 10 | # In ROS, nodes are uniquely named. If two nodes with the same 11 | # node are launched, the previous one is kicked off. The 12 | # anonymous=True flag means that rospy will choose a unique 13 | # name for our 'talker' node 14 | rospy.init_node('talker', anonymous=True) 15 | #set the loop rate 16 | rate = rospy.Rate(1) # 1hz 17 | #keep publishing until a Ctrl-C is pressed 18 | i = 0 19 | while not rospy.is_shutdown(): 20 | hello_str = "hello world %s" % i 21 | rospy.loginfo(hello_str) 22 | pub.publish(hello_str) 23 | rate.sleep() 24 | i=i+1 25 | 26 | if __name__ == '__main__': 27 | try: 28 | talker() 29 | except rospy.ROSInterruptException: 30 | pass 31 | -------------------------------------------------------------------------------- /day3/temp.txt: -------------------------------------------------------------------------------- 1 | Insert turtlesim source codes here and delete this temporary file. -------------------------------------------------------------------------------- /day4/README.md: -------------------------------------------------------------------------------- 1 | ## ROS Best Practices, Conventions and Tricks 2 | 3 | > Best practices for ROS2 in the making. See the [Foxy branch](https://github.com/leggedrobotics/ros_best_practices/tree/foxy) in the meanwhile. 4 | 5 | This is a loose collection of best practices, conventions, and tricks for using the Robot Operating System (ROS). It builds up on the official ROS documentation and other resources and is meant as summary and overview. 6 | 7 | - **📚 Read**: Head over to the [Wiki](https://github.com/leggedrobotics/ros_best_practices/wiki) to get started! 8 | - **🐛 Report**: Share [issues](https://github.com/leggedrobotics/ros_best_practices/issues) you encounter by submitting them. 9 | - **🔧 Improve**: Make these practices even better. Submit a [PR](https://github.com/leggedrobotics/ros_best_practices/pulls) to improve a specific topic. 10 | 11 | Also, check out the ROS package's [ros_package_template/readme.md](ros_package_template/README.md). 12 | -------------------------------------------------------------------------------- /day4/ros_package_template/LICENSE: -------------------------------------------------------------------------------- 1 | Software License Agreement (BSD License) 2 | 3 | Copyright (c) 2017, Peter Fankhauser 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | * Neither the name of Autonomous Systems Lab nor ETH Zurich nor the names 17 | of its contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /day4/ros_package_template/config/default.yaml: -------------------------------------------------------------------------------- 1 | subscriber_topic: /temperature -------------------------------------------------------------------------------- /day4/ros_package_template/doc/example.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sr42-dev/scaling-spoon/59e86c5f2aba61d4d87731aba5b6b042f7985120/day4/ros_package_template/doc/example.jpg -------------------------------------------------------------------------------- /day4/ros_package_template/include/ros_package_template/Algorithm.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | namespace ros_package_template { 8 | 9 | /*! 10 | * Class containing the algorithmic part of the package. 11 | */ 12 | class Algorithm 13 | { 14 | public: 15 | /*! 16 | * Constructor. 17 | */ 18 | Algorithm(); 19 | 20 | /*! 21 | * Destructor. 22 | */ 23 | virtual ~Algorithm(); 24 | 25 | /*! 26 | * Add new measurement data. 27 | * @param data the new data. 28 | */ 29 | void addData(const double data); 30 | 31 | /*! 32 | * Add multiple measurements as once. 33 | * @param data new data. 34 | */ 35 | void addData(const Eigen::VectorXd& data); 36 | 37 | /*! 38 | * Get the computed average of the data. 39 | * @return the average of the data. 40 | */ 41 | double getAverage() const; 42 | 43 | private: 44 | 45 | //! Forward declared structure that will contain the data 46 | struct Data; 47 | 48 | //! Pointer to data (pimpl) 49 | std::unique_ptr data_; 50 | }; 51 | 52 | } /* namespace */ 53 | -------------------------------------------------------------------------------- /day4/ros_package_template/include/ros_package_template/RosPackageTemplate.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ros_package_template/Algorithm.hpp" 4 | 5 | // ROS 6 | #include 7 | #include 8 | #include 9 | 10 | namespace ros_package_template { 11 | 12 | /*! 13 | * Main class for the node to handle the ROS interfacing. 14 | */ 15 | class RosPackageTemplate 16 | { 17 | public: 18 | /*! 19 | * Constructor. 20 | * @param nodeHandle the ROS node handle. 21 | */ 22 | RosPackageTemplate(ros::NodeHandle& nodeHandle); 23 | 24 | /*! 25 | * Destructor. 26 | */ 27 | virtual ~RosPackageTemplate(); 28 | 29 | private: 30 | /*! 31 | * Reads and verifies the ROS parameters. 32 | * @return true if successful. 33 | */ 34 | bool readParameters(); 35 | 36 | /*! 37 | * ROS topic callback method. 38 | * @param message the received message. 39 | */ 40 | void topicCallback(const sensor_msgs::Temperature& message); 41 | 42 | /*! 43 | * ROS service server callback. 44 | * @param request the request of the service. 45 | * @param response the provided response. 46 | * @return true if successful, false otherwise. 47 | */ 48 | bool serviceCallback(std_srvs::Trigger::Request& request, 49 | std_srvs::Trigger::Response& response); 50 | 51 | //! ROS node handle. 52 | ros::NodeHandle& nodeHandle_; 53 | 54 | //! ROS topic subscriber. 55 | ros::Subscriber subscriber_; 56 | 57 | //! ROS topic name to subscribe to. 58 | std::string subscriberTopic_; 59 | 60 | //! ROS service server. 61 | ros::ServiceServer serviceServer_; 62 | 63 | //! Algorithm computation object. 64 | Algorithm algorithm_; 65 | }; 66 | 67 | } /* namespace */ 68 | -------------------------------------------------------------------------------- /day4/ros_package_template/launch/ros_package_template.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /day4/ros_package_template/launch/ros_package_template_overlying_params.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /day4/ros_package_template/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | ros_package_template 4 | 0.1.0 5 | A template for ROS packages. 6 | Peter Fankhauser 7 | BSD 8 | https://github.com/ethz-asl/ros_best_practices 9 | https://github.com/ethz-asl/ros_best_practices/issues 10 | Peter Fankhauser 11 | 12 | 13 | catkin 14 | 15 | boost 16 | 17 | eigen 18 | roscpp 19 | sensor_msgs 20 | 21 | roslint 22 | 23 | -------------------------------------------------------------------------------- /day4/ros_package_template/src/Algorithm.cpp: -------------------------------------------------------------------------------- 1 | #include "ros_package_template/Algorithm.hpp" 2 | 3 | #include 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | namespace ros_package_template { 10 | 11 | using namespace boost::accumulators; 12 | 13 | struct Algorithm::Data { 14 | accumulator_set> acc; 15 | }; 16 | 17 | Algorithm::Algorithm() { 18 | data_ = std::make_unique(); 19 | } 20 | 21 | Algorithm::~Algorithm() = default; 22 | 23 | void Algorithm::addData(const double data) 24 | { 25 | data_->acc(data); 26 | } 27 | 28 | void Algorithm::addData(const Eigen::VectorXd& data) 29 | { 30 | for(auto i = 0; i < data.size(); ++i) 31 | addData(data[i]); 32 | } 33 | 34 | double Algorithm::getAverage() const 35 | { 36 | return count(data_->acc) ? mean(data_->acc) : 0; 37 | } 38 | 39 | } /* namespace */ 40 | -------------------------------------------------------------------------------- /day4/ros_package_template/src/RosPackageTemplate.cpp: -------------------------------------------------------------------------------- 1 | #include "ros_package_template/RosPackageTemplate.hpp" 2 | 3 | // STD 4 | #include 5 | 6 | namespace ros_package_template { 7 | 8 | RosPackageTemplate::RosPackageTemplate(ros::NodeHandle& nodeHandle) 9 | : nodeHandle_(nodeHandle) 10 | { 11 | if (!readParameters()) { 12 | ROS_ERROR("Could not read parameters."); 13 | ros::requestShutdown(); 14 | } 15 | subscriber_ = nodeHandle_.subscribe(subscriberTopic_, 1, 16 | &RosPackageTemplate::topicCallback, this); 17 | serviceServer_ = nodeHandle_.advertiseService("get_average", 18 | &RosPackageTemplate::serviceCallback, this); 19 | ROS_INFO("Successfully launched node."); 20 | } 21 | 22 | RosPackageTemplate::~RosPackageTemplate() 23 | { 24 | } 25 | 26 | bool RosPackageTemplate::readParameters() 27 | { 28 | if (!nodeHandle_.getParam("subscriber_topic", subscriberTopic_)) return false; 29 | return true; 30 | } 31 | 32 | void RosPackageTemplate::topicCallback(const sensor_msgs::Temperature& message) 33 | { 34 | algorithm_.addData(message.temperature); 35 | } 36 | 37 | bool RosPackageTemplate::serviceCallback(std_srvs::Trigger::Request& request, 38 | std_srvs::Trigger::Response& response) 39 | { 40 | response.success = true; 41 | response.message = "The average is " + std::to_string(algorithm_.getAverage()); 42 | return true; 43 | } 44 | 45 | } /* namespace */ 46 | -------------------------------------------------------------------------------- /day4/ros_package_template/src/ros_package_template_node.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "ros_package_template/RosPackageTemplate.hpp" 3 | 4 | int main(int argc, char** argv) 5 | { 6 | ros::init(argc, argv, "ros_package_template"); 7 | ros::NodeHandle nodeHandle("~"); 8 | 9 | ros_package_template::RosPackageTemplate rosPackageTemplate(nodeHandle); 10 | 11 | ros::spin(); 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /day4/ros_package_template/test/AlgorithmTest.cpp: -------------------------------------------------------------------------------- 1 | #include "ros_package_template/Algorithm.hpp" 2 | 3 | // gtest 4 | #include 5 | 6 | // STD 7 | #include 8 | 9 | #include 10 | 11 | using namespace ros_package_template; 12 | 13 | TEST(Algorithm, getWithoutSet) 14 | { 15 | Algorithm algorithm; 16 | const double average = algorithm.getAverage(); 17 | EXPECT_EQ(0.0, average); 18 | } 19 | 20 | TEST(Algorithm, singleDataPoint) 21 | { 22 | const double inputData = 100.0 * (double)rand() / RAND_MAX; 23 | Algorithm algorithm; 24 | algorithm.addData(inputData); 25 | const double average = algorithm.getAverage(); 26 | EXPECT_NEAR(inputData, average, 1e-10); 27 | } 28 | 29 | TEST(Algorithm, singleDataVector) 30 | { 31 | const double inputValue = 100.0 * (double)rand() / RAND_MAX; 32 | Algorithm algorithm; 33 | Eigen::VectorXd inputData; 34 | inputData.resize(2); 35 | inputData << inputValue, 3*inputValue; 36 | algorithm.addData(inputData); 37 | const double average = algorithm.getAverage(); 38 | EXPECT_NEAR(2*inputValue, average, 1e-10); 39 | } 40 | 41 | TEST(Algorithm, multipleDataPoints) 42 | { 43 | size_t nMeasurements = 100; 44 | std::vector inputData(nMeasurements); 45 | double sum = 0.0; 46 | for (auto& data : inputData) { 47 | data = 100.0 * (double)rand() / RAND_MAX; 48 | sum += data; 49 | } 50 | 51 | Algorithm algorithm; 52 | for (const auto data : inputData) { 53 | algorithm.addData(data); 54 | } 55 | const double average = algorithm.getAverage(); 56 | EXPECT_NEAR(sum / nMeasurements, average, 1e-10); 57 | } 58 | -------------------------------------------------------------------------------- /day4/ros_package_template/test/test_ros_package_template.cpp: -------------------------------------------------------------------------------- 1 | // gtest 2 | #include 3 | 4 | // Run all the tests that were declared with TEST() 5 | int main(int argc, char **argv) 6 | { 7 | testing::InitGoogleTest(&argc, argv); 8 | srand((int)time(0)); 9 | return RUN_ALL_TESTS(); 10 | } -------------------------------------------------------------------------------- /day4/temp.txt: -------------------------------------------------------------------------------- 1 | Insert day 4 source codes here and delete this temporary file. 2 | -------------------------------------------------------------------------------- /day5/geographic_info/README.rst: -------------------------------------------------------------------------------- 1 | geographic_info repository 2 | ========================== 3 | 4 | ROS messages and interfaces for mapping and coordinate conversions, 5 | part of the ROS Geographic Information project. 6 | 7 | * http://en.wikipedia.org/wiki/Geographic_information_system 8 | 9 | ROS documentation: 10 | 11 | * http://wiki.ros.org/geographic_info 12 | * http://wiki.ros.org/geographic_msgs 13 | * http://wiki.ros.org/geodesy 14 | -------------------------------------------------------------------------------- /day5/geographic_info/geodesy/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | Change history 2 | ============== 3 | 4 | 0.5.3 (2018-03-27) 5 | ------------------ 6 | 7 | 0.5.2 (2017-04-15) 8 | ------------------ 9 | 10 | 0.5.1 (2017-04-15) 11 | ------------------ 12 | 13 | 0.5.0 (2017-04-07) 14 | ------------------ 15 | 16 | * Removed Python setup install_requires option. 17 | 18 | 0.4.0 (2014-09-18) 19 | ------------------ 20 | 21 | * Released to Indigo. 22 | * Remove deprecated geodesy.gen_uuid module (`#4`_). 23 | 24 | 0.3.2 (2014-08-30) 25 | ------------------ 26 | 27 | * Released to Indigo. 28 | * Make C++ template declaration for WGS-84 header compatible with GCC 29 | 4.7 compiler (`#12`_), thanks to Mike Purvis and Dirk Thomas. 30 | 31 | 0.3.1 (2013-10-03) 32 | ------------------ 33 | 34 | * Fix ROS Hydro header install problem (`#9`_). 35 | 36 | 0.3.0 (2013-08-03) 37 | ------------------ 38 | 39 | * Released to Hydro. 40 | * Convert to catkin build (`#3`_). 41 | * Remove unnecessary roscpp and rospy dependencies (`#6`_). 42 | 43 | 0.2.1 (2012-08-13) 44 | ------------------ 45 | 46 | * Released to Fuerte. 47 | * Released to Groovy: 2013-03-27. 48 | * Use unique_identifier for UUID interfaces. 49 | 50 | 0.2.0 (2012-06-02) 51 | ------------------ 52 | 53 | * Many new mapping messages and services added. 54 | * Use PROJ.4 library for Python geodesy API (C++ API not ported to 55 | PROJ.4 yet). 56 | * Released to Electric. 57 | 58 | 0.1.0 (2012-04-10) 59 | ------------------ 60 | 61 | * Initial release to Electric. 62 | 63 | .. _`#3`: https://github.com/ros-geographic-info/geographic_info/issues/3 64 | .. _`#4`: https://github.com/ros-geographic-info/geographic_info/issues/4 65 | .. _`#6`: https://github.com/ros-geographic-info/geographic_info/issues/6 66 | .. _`#9`: https://github.com/ros-geographic-info/geographic_info/issues/9 67 | .. _`#12`: https://github.com/ros-geographic-info/geographic_info/issues/12 68 | -------------------------------------------------------------------------------- /day5/geographic_info/geodesy/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # http://ros.org/doc/groovy/api/catkin/html/user_guide/supposed.html 2 | cmake_minimum_required(VERSION 3.0.2) 3 | project(geodesy) 4 | find_package(catkin REQUIRED 5 | COMPONENTS 6 | angles 7 | geographic_msgs 8 | geometry_msgs 9 | sensor_msgs 10 | tf 11 | unique_id 12 | uuid_msgs) 13 | 14 | include_directories(include ${catkin_INCLUDE_DIRS}) 15 | catkin_python_setup() 16 | 17 | # what other packages will need to use this one 18 | catkin_package(CATKIN_DEPENDS 19 | geographic_msgs 20 | geometry_msgs 21 | sensor_msgs 22 | tf 23 | unique_id 24 | uuid_msgs 25 | INCLUDE_DIRS include 26 | LIBRARIES geoconv) 27 | 28 | # build C++ coordinate conversion library 29 | add_library(geoconv src/conv/utm_conversions.cpp) 30 | target_link_libraries(geoconv ${catkin_LIBRARIES}) 31 | add_dependencies(geoconv ${catkin_EXPORTED_TARGETS}) 32 | 33 | install(DIRECTORY include/${PROJECT_NAME}/ 34 | DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}) 35 | install(TARGETS geoconv 36 | RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} 37 | ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 38 | LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}) 39 | 40 | # unit tests 41 | if (CATKIN_ENABLE_TESTING) 42 | 43 | catkin_add_gtest(test_wgs84 tests/test_wgs84.cpp) 44 | target_link_libraries(test_wgs84 ${catkin_LIBRARIES}) 45 | add_dependencies(test_wgs84 ${catkin_EXPORTED_TARGETS}) 46 | 47 | catkin_add_gtest(test_utm tests/test_utm.cpp) 48 | target_link_libraries(test_utm geoconv ${catkin_LIBRARIES}) 49 | add_dependencies(test_utm ${catkin_EXPORTED_TARGETS}) 50 | 51 | catkin_add_nosetests(tests/test_bounding_box.py) 52 | catkin_add_nosetests(tests/test_props.py) 53 | catkin_add_nosetests(tests/test_utm.py) 54 | catkin_add_nosetests(tests/test_wu_point.py) 55 | 56 | endif (CATKIN_ENABLE_TESTING) 57 | -------------------------------------------------------------------------------- /day5/geographic_info/geodesy/doc/geodesy.bounding_box.rst: -------------------------------------------------------------------------------- 1 | geodesy.bounding_box 2 | -------------------- 3 | 4 | .. automodule:: geodesy.bounding_box 5 | :members: 6 | -------------------------------------------------------------------------------- /day5/geographic_info/geodesy/doc/geodesy.gen_uuid.rst: -------------------------------------------------------------------------------- 1 | geodesy.gen_uuid 2 | ---------------- 3 | 4 | .. module:: geodesy.gen_uuid 5 | 6 | Generate UUIDs for Geographic Information messages. 7 | 8 | .. deprecated:: 0.3.0 9 | 10 | *This module was removed with version 0.4.0 in ROS Indigo.* 11 | 12 | Instead, use the `unique_id`_ package, which has been stable and 13 | available since ROS Fuerte: 14 | 15 | * ``geodesy.gen_uuid.generate(url, id)`` becomes 16 | ``unique_id.fromURL(url+str(id))`` 17 | 18 | * ``geodesy.gen_uuid.makeUniqueID(url, id)`` becomes 19 | ``unique_id.toMsg(unique_id.fromURL(url+str(id)))`` 20 | 21 | .. _`unique_id`: http://wiki.ros.org/unique_id 22 | -------------------------------------------------------------------------------- /day5/geographic_info/geodesy/doc/geodesy.props.rst: -------------------------------------------------------------------------------- 1 | geodesy.props 2 | ------------- 3 | 4 | .. automodule:: geodesy.props 5 | :members: 6 | -------------------------------------------------------------------------------- /day5/geographic_info/geodesy/doc/geodesy.utm.rst: -------------------------------------------------------------------------------- 1 | geodesy.utm 2 | ----------- 3 | 4 | .. automodule:: geodesy.utm 5 | :members: 6 | -------------------------------------------------------------------------------- /day5/geographic_info/geodesy/doc/geodesy.wu_point.rst: -------------------------------------------------------------------------------- 1 | geodesy.wu_point 2 | ---------------- 3 | 4 | .. automodule:: geodesy.wu_point 5 | :members: 6 | -------------------------------------------------------------------------------- /day5/geographic_info/geodesy/doc/index.rst: -------------------------------------------------------------------------------- 1 | .. geodesy documentation master file, created by 2 | sphinx-quickstart on Wed Apr 25 16:01:20 2012. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | geodesy: Python APIs for Geographic coordinates 7 | =============================================== 8 | 9 | Contents: 10 | 11 | .. toctree:: 12 | :maxdepth: 2 13 | :glob: 14 | 15 | geodesy.* 16 | CHANGELOG 17 | 18 | Indices and tables 19 | ================== 20 | 21 | * :ref:`genindex` 22 | * :ref:`modindex` 23 | -------------------------------------------------------------------------------- /day5/geographic_info/geodesy/mainpage.dox: -------------------------------------------------------------------------------- 1 | /** 2 | \mainpage 3 | \htmlinclude manifest.html 4 | 5 | This package provides C++ APIs for manipulating geodetic coordinates. 6 | 7 | It has no nodes, utilities, or scripts. 8 | 9 | */ 10 | -------------------------------------------------------------------------------- /day5/geographic_info/geodesy/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | geodesy 5 | 0.5.6 6 | 7 | Python and C++ interfaces for manipulating geodetic coordinates. 8 | 9 | Jack O'Quin 10 | Steve Macenski 11 | Jack O'Quin 12 | BSD 13 | 14 | http://wiki.ros.org/geodesy 15 | https://github.com/ros-geographic-info/geographic_info/issues 16 | https://github.com/ros-geographic-info/geographic_info.git 17 | 18 | catkin 19 | 20 | angles 21 | geographic_msgs 22 | geometry_msgs 23 | sensor_msgs 24 | tf 25 | unique_id 26 | uuid_msgs 27 | 28 | geographic_msgs 29 | geometry_msgs 30 | tf 31 | sensor_msgs 32 | unique_id 33 | uuid_msgs 34 | 35 | python-pyproj 36 | python3-pyproj 37 | 38 | python-setuptools 39 | python3-setuptools 40 | 41 | 42 | rosunit 43 | 44 | 45 | python-catkin-pkg-modules 46 | python3-catkin-pkg-modules 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /day5/geographic_info/geodesy/rosdoc.yaml: -------------------------------------------------------------------------------- 1 | - builder: doxygen 2 | name: C++ API 3 | output_dir: c++ 4 | file_patterns: '*.c *.cpp *.h *.cc *.hh *.dox' 5 | - builder: sphinx 6 | name: Python API 7 | sphinx_root_dir: doc 8 | output_dir: python 9 | 10 | -------------------------------------------------------------------------------- /day5/geographic_info/geodesy/setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from catkin_pkg.python_setup import generate_distutils_setup 4 | from setuptools import setup 5 | 6 | d = generate_distutils_setup( 7 | packages=['geodesy'], 8 | package_dir={'': 'src'}, 9 | ) 10 | 11 | setup(**d) 12 | -------------------------------------------------------------------------------- /day5/geographic_info/geodesy/src/geodesy/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sr42-dev/scaling-spoon/59e86c5f2aba61d4d87731aba5b6b042f7985120/day5/geographic_info/geodesy/src/geodesy/__init__.py -------------------------------------------------------------------------------- /day5/geographic_info/geodesy/tests/test_bounding_box.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import unittest 4 | 5 | from geodesy.bounding_box import * # module being tested 6 | 7 | class TestPythonBoundingBox(unittest.TestCase): 8 | """Unit tests for Python bounding box functions. """ 9 | 10 | def test_global_bounding_box(self): 11 | bb = makeGlobal() 12 | self.assertTrue(isGlobal(bb)) 13 | 14 | def test_2d_bounding_box(self): 15 | min_lat = 30.3787400 16 | min_lon = -97.7344500 17 | max_lat = 30.3947700 18 | max_lon = -97.7230800 19 | bb = makeBounds2D(min_lat, min_lon, max_lat, max_lon) 20 | self.assertFalse(isGlobal(bb)) 21 | self.assertTrue(is2D(bb)) 22 | min_lat2, min_lon2, max_lat2, max_lon2 = getLatLong(bb) 23 | self.assertEqual(min_lat, min_lat2) 24 | self.assertEqual(min_lon, min_lon2) 25 | self.assertEqual(max_lat, max_lat2) 26 | self.assertEqual(max_lon, max_lon2) 27 | 28 | def test_3d_bounding_box(self): 29 | min_lat = 30.3787400 30 | min_lon = -97.7344500 31 | min_alt = 200.0 32 | max_lat = 30.3947700 33 | max_lon = -97.7230800 34 | max_alt = 400.0 35 | bb = makeBounds3D(min_lat, min_lon, min_alt, 36 | max_lat, max_lon, max_alt) 37 | self.assertFalse(isGlobal(bb)) 38 | self.assertFalse(is2D(bb)) 39 | min_lat2, min_lon2, max_lat2, max_lon2 = getLatLong(bb) 40 | self.assertEqual(min_lat, min_lat2) 41 | self.assertEqual(min_lon, min_lon2) 42 | self.assertEqual(min_alt, bb.min_pt.altitude) 43 | self.assertEqual(max_lat, max_lat2) 44 | self.assertEqual(max_lon, max_lon2) 45 | self.assertEqual(max_alt, bb.max_pt.altitude) 46 | 47 | if __name__ == '__main__': 48 | import rosunit 49 | PKG='geodesy' 50 | rosunit.unitrun(PKG, 'test_uuid_py', TestPythonBoundingBox) 51 | -------------------------------------------------------------------------------- /day5/geographic_info/geographic_info/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | Change history 2 | ============== 3 | 4 | 0.5.3 (2018-03-27) 5 | ------------------ 6 | 7 | 0.5.2 (2017-04-15) 8 | ------------------ 9 | 10 | 0.5.1 (2017-04-15) 11 | ------------------ 12 | 13 | 0.5.0 (2017-04-07) 14 | ------------------ 15 | 16 | 0.4.0 (2014-09-18) 17 | ------------------ 18 | 19 | 0.3.2 (2014-08-30) 20 | ------------------ 21 | 22 | 0.3.1 (2013-10-03) 23 | ------------------ 24 | 25 | 0.3.0 (2013-08-03) 26 | ------------------ 27 | 28 | * Released to Hydro. 29 | * Convert to catkin build (`#3`_). 30 | * Make **geographic_info** into a metapackage, depending on the 31 | **geographic_msgs** and **geodesy** packages. It should only be 32 | used for dependencies in dry stacks. Wet packages will depend 33 | directly on **geographic_msgs** and **geodesy**. 34 | 35 | 0.2.1 (2012-08-13) 36 | ------------------ 37 | 38 | * Released to Fuerte. 39 | * Released to Groovy: 2013-03-27. 40 | 41 | 0.2.0 (2012-06-02) 42 | ------------------ 43 | 44 | * Released to Electric. 45 | 46 | 0.1.0 (2012-04-10) 47 | ------------------ 48 | 49 | * Initial release to Electric. 50 | 51 | .. _`#3`: https://github.com/ros-geographic-info/geographic_info/issues/3 52 | -------------------------------------------------------------------------------- /day5/geographic_info/geographic_info/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.0.2) 2 | project(geographic_info) 3 | find_package(catkin REQUIRED) 4 | catkin_metapackage() 5 | -------------------------------------------------------------------------------- /day5/geographic_info/geographic_info/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | geographic_info 4 | 0.5.6 5 | 6 | Geographic information metapackage. 7 | 8 | Not needed for wet packages, use only to resolve dry stack 9 | dependencies. 10 | 11 | Jack O'Quin 12 | Jack O'Quin 13 | BSD 14 | http://wiki.ros.org/geographic_info 15 | https://github.com/ros-geographic-info/geographic_info 16 | https://github.com/ros-geographic-info/geographic_info/issues 17 | 18 | catkin 19 | 20 | geodesy 21 | geographic_msgs 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /day5/geographic_info/geographic_msgs/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | Change history 2 | ============== 3 | 4 | 0.5.3 (2018-03-27) 5 | ------------------ 6 | 7 | * Add additional information to ``GetGeoPath`` service response. 8 | 9 | 0.5.2 (2017-04-15) 10 | ------------------ 11 | 12 | * Fix merge error in GeoPath message. 13 | 14 | 0.5.1 (2017-04-15) 15 | ------------------ 16 | 17 | * Add GeoPath message with poses. 18 | * Add GetGeoPath service (`#7`_). 19 | 20 | 0.5.0 (2017-04-07) 21 | ------------------ 22 | 23 | * Add new ``GeoPointStamped`` and ``GeoPoseStamped`` messages. 24 | 25 | 0.4.0 (2014-09-18) 26 | ------------------ 27 | 28 | 0.3.2 (2014-08-30) 29 | ------------------ 30 | 31 | * Add missing ``geometry_msgs`` dependency to ``catkin_package()`` 32 | components in CMakeLists.txt (`#13`_), thanks to Timo Roehling. 33 | 34 | 0.3.1 (2013-10-03) 35 | ------------------ 36 | 37 | 0.3.0 (2013-08-03) 38 | ------------------ 39 | 40 | * Released to Hydro. 41 | * Convert to catkin build (`#3`_). 42 | 43 | 0.2.1 (2012-08-13) 44 | ------------------ 45 | 46 | * Released to Fuerte. 47 | * Released to Groovy: 2013-03-27. 48 | 49 | 0.2.0 (2012-06-02) 50 | ------------------ 51 | 52 | * Released to Electric. 53 | 54 | 0.1.0 (2012-04-10) 55 | ------------------ 56 | 57 | * Initial release to Electric. 58 | 59 | .. _`#3`: https://github.com/ros-geographic-info/geographic_info/issues/3 60 | .. _`#6`: https://github.com/ros-geographic-info/geographic_info/issues/6 61 | .. _`#7`: https://github.com/ros-geographic-info/geographic_info/issues/7 62 | .. _`#13`: https://github.com/ros-geographic-info/geographic_info/pull/13 63 | -------------------------------------------------------------------------------- /day5/geographic_info/geographic_msgs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.0.2) 2 | project(geographic_msgs) 3 | 4 | find_package(catkin REQUIRED 5 | COMPONENTS 6 | message_generation 7 | geometry_msgs 8 | std_msgs 9 | uuid_msgs 10 | ) 11 | 12 | add_message_files( 13 | DIRECTORY msg 14 | FILES 15 | BoundingBox.msg 16 | GeographicMapChanges.msg 17 | GeographicMap.msg 18 | GeoPath.msg 19 | GeoPoint.msg 20 | GeoPointStamped.msg 21 | GeoPose.msg 22 | GeoPoseWithCovariance.msg 23 | GeoPoseStamped.msg 24 | GeoPoseWithCovarianceStamped.msg 25 | KeyValue.msg 26 | MapFeature.msg 27 | RouteNetwork.msg 28 | RoutePath.msg 29 | RouteSegment.msg 30 | WayPoint.msg 31 | ) 32 | 33 | add_service_files( 34 | DIRECTORY srv 35 | FILES 36 | GetGeographicMap.srv 37 | GetGeoPath.srv 38 | GetRoutePlan.srv 39 | UpdateGeographicMap.srv 40 | ) 41 | 42 | generate_messages( 43 | DEPENDENCIES 44 | geometry_msgs 45 | std_msgs 46 | uuid_msgs 47 | ) 48 | 49 | catkin_package( 50 | CATKIN_DEPENDS message_runtime geometry_msgs uuid_msgs std_msgs 51 | ) 52 | -------------------------------------------------------------------------------- /day5/geographic_info/geographic_msgs/mainpage.dox: -------------------------------------------------------------------------------- 1 | /** 2 | \mainpage 3 | \htmlinclude manifest.html 4 | 5 | This package provides ROS messages for Geographic Information. 6 | 7 | It has no nodes, utilities, scripts or C++ API. 8 | 9 | */ 10 | -------------------------------------------------------------------------------- /day5/geographic_info/geographic_msgs/msg/BoundingBox.msg: -------------------------------------------------------------------------------- 1 | # Geographic map bounding box. 2 | # 3 | # The two GeoPoints denote diagonally opposite corners of the box. 4 | # 5 | # If min_pt.latitude is NaN, the bounding box is "global", matching 6 | # any valid latitude, longitude and altitude. 7 | # 8 | # If min_pt.altitude is NaN, the bounding box is two-dimensional and 9 | # matches any altitude within the specified latitude and longitude 10 | # range. 11 | 12 | GeoPoint min_pt # lowest and most Southwestern corner 13 | GeoPoint max_pt # highest and most Northeastern corner 14 | -------------------------------------------------------------------------------- /day5/geographic_info/geographic_msgs/msg/GeoPath.msg: -------------------------------------------------------------------------------- 1 | std_msgs/Header header 2 | geographic_msgs/GeoPoseStamped[] poses 3 | -------------------------------------------------------------------------------- /day5/geographic_info/geographic_msgs/msg/GeoPoint.msg: -------------------------------------------------------------------------------- 1 | # Geographic point, using the WGS 84 reference ellipsoid. 2 | 3 | # Latitude [degrees]. Positive is north of equator; negative is south 4 | # (-90 <= latitude <= +90). 5 | float64 latitude 6 | 7 | # Longitude [degrees]. Positive is east of prime meridian; negative is 8 | # west (-180 <= longitude <= +180). At the poles, latitude is -90 or 9 | # +90, and longitude is irrelevant, but must be in range. 10 | float64 longitude 11 | 12 | # Altitude [m]. Positive is above the WGS 84 ellipsoid (NaN if unspecified). 13 | float64 altitude 14 | -------------------------------------------------------------------------------- /day5/geographic_info/geographic_msgs/msg/GeoPointStamped.msg: -------------------------------------------------------------------------------- 1 | Header header 2 | geographic_msgs/GeoPoint position 3 | -------------------------------------------------------------------------------- /day5/geographic_info/geographic_msgs/msg/GeoPose.msg: -------------------------------------------------------------------------------- 1 | # Geographic pose, using the WGS 84 reference ellipsoid. 2 | # 3 | # Orientation uses the East-North-Up (ENU) frame of reference. 4 | # (But, what about singularities at the poles?) 5 | 6 | GeoPoint position 7 | geometry_msgs/Quaternion orientation 8 | -------------------------------------------------------------------------------- /day5/geographic_info/geographic_msgs/msg/GeoPoseStamped.msg: -------------------------------------------------------------------------------- 1 | Header header 2 | geographic_msgs/GeoPose pose 3 | -------------------------------------------------------------------------------- /day5/geographic_info/geographic_msgs/msg/GeoPoseWithCovariance.msg: -------------------------------------------------------------------------------- 1 | # Geographic pose, using the WGS 84 reference ellipsoid. 2 | # 3 | # Orientation uses the East-North-Up (ENU) frame of reference. 4 | # (But, what about singularities at the poles?) 5 | 6 | GeoPose pose 7 | 8 | # Row-major representation of the 6x6 covariance matrix 9 | # The orientation parameters use a fixed-axis representation. 10 | # In order, the parameters are: 11 | # (Lat, Lon, Alt, rotation about E (East) axis, rotation about N (North) axis, rotation about U (Up) axis) 12 | float64[36] covariance 13 | -------------------------------------------------------------------------------- /day5/geographic_info/geographic_msgs/msg/GeoPoseWithCovarianceStamped.msg: -------------------------------------------------------------------------------- 1 | Header header 2 | geographic_msgs/GeoPoseWithCovariance pose 3 | -------------------------------------------------------------------------------- /day5/geographic_info/geographic_msgs/msg/GeographicMap.msg: -------------------------------------------------------------------------------- 1 | # Geographic map for a specified region. 2 | 3 | Header header # stamp specifies time 4 | # frame_id (normally /map) 5 | 6 | uuid_msgs/UniqueID id # identifier for this map 7 | BoundingBox bounds # 2D bounding box containing map 8 | 9 | WayPoint[] points # way-points 10 | MapFeature[] features # map features 11 | KeyValue[] props # map properties 12 | -------------------------------------------------------------------------------- /day5/geographic_info/geographic_msgs/msg/GeographicMapChanges.msg: -------------------------------------------------------------------------------- 1 | # A list of geographic map changes. 2 | 3 | Header header # stamp specifies time of change 4 | # frame_id (normally /map) 5 | 6 | GeographicMap diffs # new and changed points and features 7 | uuid_msgs/UniqueID[] deletes # deleted map components 8 | -------------------------------------------------------------------------------- /day5/geographic_info/geographic_msgs/msg/KeyValue.msg: -------------------------------------------------------------------------------- 1 | # Geographic map tag (key, value) pair 2 | # 3 | # This is equivalent to diagnostic_msgs/KeyValue, repeated here to 4 | # avoid introducing a trivial stack dependency. 5 | 6 | string key # tag label 7 | string value # corresponding value 8 | -------------------------------------------------------------------------------- /day5/geographic_info/geographic_msgs/msg/MapFeature.msg: -------------------------------------------------------------------------------- 1 | # Geographic map feature. 2 | # 3 | # A list of WayPoint IDs for features like streets, highways, hiking 4 | # trails, the outlines of buildings and parking lots in sequential 5 | # order. 6 | # 7 | # Feature lists may also contain other feature lists as members. 8 | 9 | uuid_msgs/UniqueID id # Unique feature identifier 10 | uuid_msgs/UniqueID[] components # Sequence of feature components 11 | KeyValue[] props # Key/value properties for this feature 12 | -------------------------------------------------------------------------------- /day5/geographic_info/geographic_msgs/msg/RouteNetwork.msg: -------------------------------------------------------------------------------- 1 | # Geographic map route network. 2 | # 3 | # A directed graph of WayPoint nodes and RouteSegment edges. This 4 | # information is extracted from the more-detailed contents of a 5 | # GeographicMap. A RouteNetwork contains only the way points and 6 | # route segments of interest for path planning. 7 | 8 | Header header 9 | 10 | uuid_msgs/UniqueID id # This route network identifier 11 | BoundingBox bounds # 2D bounding box for network 12 | 13 | WayPoint[] points # Way points in this network 14 | RouteSegment[] segments # Directed edges of this network 15 | 16 | KeyValue[] props # Network key/value properties 17 | -------------------------------------------------------------------------------- /day5/geographic_info/geographic_msgs/msg/RoutePath.msg: -------------------------------------------------------------------------------- 1 | # Path through a route network. 2 | # 3 | # A path is a sequence of RouteSegment edges. This information is 4 | # extracted from a RouteNetwork graph. A RoutePath lists the route 5 | # segments needed to reach some chosen goal. 6 | 7 | Header header 8 | 9 | uuid_msgs/UniqueID network # Route network containing this path 10 | uuid_msgs/UniqueID[] segments # Sequence of RouteSegment IDs 11 | KeyValue[] props # Key/value properties 12 | -------------------------------------------------------------------------------- /day5/geographic_info/geographic_msgs/msg/RouteSegment.msg: -------------------------------------------------------------------------------- 1 | # Route network segment. 2 | # 3 | # This is one directed edge of a RouteNetwork graph. It represents a 4 | # known path from one way point to another. If the path is two-way, 5 | # there will be another RouteSegment with "start" and "end" reversed. 6 | 7 | uuid_msgs/UniqueID id # Unique identifier for this segment 8 | 9 | uuid_msgs/UniqueID start # beginning way point of segment 10 | uuid_msgs/UniqueID end # ending way point of segment 11 | 12 | KeyValue[] props # segment properties 13 | -------------------------------------------------------------------------------- /day5/geographic_info/geographic_msgs/msg/WayPoint.msg: -------------------------------------------------------------------------------- 1 | # Way-point element for a geographic map. 2 | 3 | uuid_msgs/UniqueID id # Unique way-point identifier 4 | GeoPoint position # Position relative to WGS 84 ellipsoid 5 | KeyValue[] props # Key/value properties for this point 6 | -------------------------------------------------------------------------------- /day5/geographic_info/geographic_msgs/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | geographic_msgs 4 | 0.5.6 5 | 6 | ROS messages for Geographic Information Systems. 7 | 8 | Jack O'Quin 9 | Jack O'Quin 10 | BSD 11 | 12 | http://wiki.ros.org/geographic_msgs 13 | https://github.com/ros-geographic-info/geographic_info/issues 14 | https://github.com/ros-geographic-info/geographic_info.git 15 | 16 | catkin 17 | 18 | message_generation 19 | geometry_msgs 20 | std_msgs 21 | uuid_msgs 22 | 23 | message_runtime 24 | geometry_msgs 25 | std_msgs 26 | uuid_msgs 27 | 28 | 29 | -------------------------------------------------------------------------------- /day5/geographic_info/geographic_msgs/srv/GetGeoPath.srv: -------------------------------------------------------------------------------- 1 | # Searches for given start and goal the nearest route segments 2 | # and determine the path through the RouteNetwork 3 | 4 | geographic_msgs/GeoPoint start # starting point 5 | geographic_msgs/GeoPoint goal # goal point 6 | 7 | --- 8 | 9 | bool success # true if the call succeeded 10 | string status # more details 11 | 12 | geographic_msgs/GeoPath plan # path to follow 13 | 14 | uuid_msgs/UniqueID network # the uuid of the RouteNetwork 15 | uuid_msgs/UniqueID start_seg # the uuid of the starting RouteSegment 16 | uuid_msgs/UniqueID goal_seg # the uuid of the ending RouteSegment 17 | float64 distance # the length of the plan 18 | -------------------------------------------------------------------------------- /day5/geographic_info/geographic_msgs/srv/GetGeographicMap.srv: -------------------------------------------------------------------------------- 1 | # This service requests a region of a geographic map. 2 | 3 | string url # where to read map data 4 | 5 | # Bounding box for the desired map. If all zeros, provide all data 6 | # available from the specified URL. 7 | BoundingBox bounds 8 | 9 | --- 10 | 11 | bool success # true if the call succeeded 12 | string status # more details 13 | 14 | # The requested map, its bounds may differ from the requested bounds. 15 | GeographicMap map 16 | -------------------------------------------------------------------------------- /day5/geographic_info/geographic_msgs/srv/GetRoutePlan.srv: -------------------------------------------------------------------------------- 1 | # Get a plan to traverse a route network from start to goal. 2 | # 3 | # Similar to nav_msgs/GetPlan, but constrained to use the route network. 4 | 5 | uuid_msgs/UniqueID network # route network to use 6 | uuid_msgs/UniqueID start # starting way point 7 | uuid_msgs/UniqueID goal # goal way point 8 | 9 | --- 10 | 11 | bool success # true if the call succeeded 12 | string status # more details 13 | 14 | RoutePath plan # path to follow 15 | -------------------------------------------------------------------------------- /day5/geographic_info/geographic_msgs/srv/UpdateGeographicMap.srv: -------------------------------------------------------------------------------- 1 | # This service updates a geographic map. 2 | 3 | # Changes to geographic map. 4 | GeographicMapChanges updates 5 | 6 | --- 7 | 8 | bool success # true if the call succeeded 9 | string status # more details 10 | -------------------------------------------------------------------------------- /day5/temp.txt: -------------------------------------------------------------------------------- 1 | Add files for the PID controller here. 2 | -------------------------------------------------------------------------------- /day5/unique_identifier/README.rst: -------------------------------------------------------------------------------- 1 | unique_identifier 2 | ================= 3 | 4 | ROS messages and interfaces for Universally Unique Identifiers. 5 | 6 | * http://en.wikipedia.org/wiki/Uuid 7 | * http://tools.ietf.org/html/rfc4122.html 8 | 9 | ROS documentation: 10 | 11 | * http://www.ros.org/wiki/unique_id 12 | * http://www.ros.org/wiki/unique_identifier 13 | * http://www.ros.org/wiki/uuid_msgs 14 | -------------------------------------------------------------------------------- /day5/unique_identifier/unique_id/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | Change history 2 | ============== 3 | 4 | 1.0.6 (2017-04-04) 5 | ------------------ 6 | 7 | * Remove Python ``install_requires`` option. 8 | * Fix minor catkin lint issues. 9 | 10 | 1.0.5 (2015-04-17) 11 | ------------------ 12 | 13 | * Alter C++ unique_id functions to work in multiple cpp files (`#7`_). 14 | 15 | 1.0.4 (2014-04-30) 16 | ------------------ 17 | 18 | 1.0.3 (2013-07-24) 19 | ------------------ 20 | 21 | * Make unit tests conditional on ``CATKIN_ENABLE_TESTING``. 22 | 23 | 1.0.2 (2013-07-18) 24 | ------------------- 25 | 26 | 1.0.1 (2013-03-25) 27 | ------------------- 28 | 29 | * Fix catkin Python install problem (`#4`_). 30 | 31 | 1.0.0 (2013-03-18) 32 | ------------------- 33 | 34 | * Hydro release. 35 | * Convert to catkin (`#1`_). 36 | 37 | 0.9.0 (2013-01-03) 38 | ------------------ 39 | 40 | * Initial release to Groovy. 41 | * Add support for C++ interface using boost uuid package. 42 | 43 | 0.8.0 (2012-07-19) 44 | ------------------ 45 | 46 | * Initial release to Fuerte. 47 | * Supports Python interface based on standard uuid package, but no 48 | C++ API yet. 49 | 50 | .. _`#1`: https://github.com/ros-geographic-info/unique_identifier/issues/1 51 | .. _`#4`: https://github.com/ros-geographic-info/unique_identifier/issues/4 52 | .. _`#7`: https://github.com/ros-geographic-info/unique_identifier/issues/7 53 | -------------------------------------------------------------------------------- /day5/unique_identifier/unique_id/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.3) 2 | project(unique_id) 3 | 4 | find_package(catkin REQUIRED COMPONENTS roscpp rospy uuid_msgs) 5 | find_package(Boost REQUIRED) 6 | include_directories(include ${catkin_INCLUDE_DIRS}) 7 | 8 | catkin_python_setup() 9 | catkin_package(INCLUDE_DIRS include 10 | CATKIN_DEPENDS uuid_msgs 11 | DEPENDS Boost) 12 | 13 | install(DIRECTORY include/${PROJECT_NAME}/ 14 | DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}) 15 | 16 | # unit tests 17 | if (CATKIN_ENABLE_TESTING) 18 | add_subdirectory(tests) 19 | endif() 20 | -------------------------------------------------------------------------------- /day5/unique_identifier/unique_id/index.rst: -------------------------------------------------------------------------------- 1 | unique_id: ROS universally unique identifier support 2 | ==================================================== 3 | 4 | Contents: 5 | 6 | .. toctree:: 7 | :maxdepth: 2 8 | 9 | unique_id 10 | CHANGELOG 11 | 12 | Indices and tables 13 | ================== 14 | 15 | * :ref:`genindex` 16 | * :ref:`modindex` 17 | -------------------------------------------------------------------------------- /day5/unique_identifier/unique_id/mainpage.dox: -------------------------------------------------------------------------------- 1 | /** 2 | \mainpage 3 | \htmlinclude manifest.html 4 | 5 | This package provides Python and C++ interfaces for managing 6 | universally unique identifiers. 7 | 8 | There are no ROS nodes or commands. 9 | 10 | Note: For Time-Based UUID generation using the C++ interface 11 | seed the random number generator through srand() 12 | 13 | */ 14 | -------------------------------------------------------------------------------- /day5/unique_identifier/unique_id/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | unique_id 6 | 1.0.6 7 | 8 | ROS Python and C++ interfaces for universally unique identifiers. 9 | 10 | Jack O'Quin 11 | Jack O'Quin 12 | BSD 13 | http://ros.org/wiki/unique_id 14 | 15 | catkin 16 | 17 | roscpp 18 | rospy 19 | uuid_msgs 20 | 21 | rosunit 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /day5/unique_identifier/unique_id/rosdoc.yaml: -------------------------------------------------------------------------------- 1 | - builder: doxygen 2 | name: C++ API 3 | output_dir: c++ 4 | file_patterns: '*.c *.cpp *.h *.cc *.hh *.dox' 5 | - builder: sphinx 6 | name: Python API 7 | output_dir: python 8 | 9 | -------------------------------------------------------------------------------- /day5/unique_identifier/unique_id/setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from distutils.core import setup 4 | from catkin_pkg.python_setup import generate_distutils_setup 5 | 6 | d = generate_distutils_setup( 7 | packages=['unique_id'], 8 | package_dir={'': 'src'}, 9 | ) 10 | 11 | setup(**d) 12 | -------------------------------------------------------------------------------- /day5/unique_identifier/unique_id/tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ### Unit tests 2 | # 3 | # Only configured when CATKIN_ENABLE_TESTING is true. 4 | 5 | # C++ gtests 6 | catkin_add_gtest(test_${PROJECT_NAME} 7 | test_${PROJECT_NAME}.cpp 8 | second_test_${PROJECT_NAME}.cpp) 9 | add_dependencies(test_${PROJECT_NAME} ${catkin_EXPORTED_TARGETS}) 10 | target_link_libraries(test_${PROJECT_NAME} 11 | ${Boost_LIBRARIES} 12 | ${catkin_LIBRARIES}) 13 | 14 | # Python nose tests 15 | catkin_add_nosetests(test_${PROJECT_NAME}.py) 16 | -------------------------------------------------------------------------------- /day5/unique_identifier/unique_id/unique_id.rst: -------------------------------------------------------------------------------- 1 | unique_id 2 | --------- 3 | 4 | .. automodule:: unique_id 5 | :members: 6 | -------------------------------------------------------------------------------- /day5/unique_identifier/unique_identifier/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | Change history 2 | ============== 3 | 4 | 1.0.6 (2017-04-04) 5 | ------------------ 6 | 7 | 1.0.5 (2015-04-17) 8 | ------------------ 9 | 10 | 1.0.4 (2014-04-30) 11 | ------------------ 12 | 13 | * add architecture independent tag 14 | 15 | 1.0.3 (2013-07-24) 16 | ------------------ 17 | 18 | 1.0.2 (2013-07-18) 19 | ------------------- 20 | 21 | * Add missing metapackage dependency on catkin (`#5`_). 22 | 23 | 1.0.1 (2013-03-25) 24 | ------------------- 25 | 26 | * Hydro release update. 27 | 28 | 1.0.0 (2013-03-18) 29 | ------------------- 30 | 31 | * Hydro release. 32 | * Convert to catkin (`#1`_). 33 | * Make **unique_identifier** into a metapackage, depending on the 34 | **uuid_msgs** and **unique_id** packages. It should only be used 35 | for dependencies in dry stacks. Wet packages will depend directly 36 | on **uuid_msgs** and **unique_id**. 37 | 38 | 0.9.0 (2013-01-03) 39 | ------------------ 40 | 41 | * Initial release to Groovy. 42 | 43 | 0.8.0 (2012-07-19) 44 | ------------------ 45 | 46 | * Initial release to Fuerte. 47 | 48 | .. _`#1`: https://github.com/ros-geographic-info/unique_identifier/issues/1 49 | .. _`#5`: https://github.com/ros-geographic-info/unique_identifier/issues/5 50 | -------------------------------------------------------------------------------- /day5/unique_identifier/unique_identifier/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.3) 2 | project(unique_identifier) 3 | find_package(catkin REQUIRED) 4 | catkin_metapackage() 5 | -------------------------------------------------------------------------------- /day5/unique_identifier/unique_identifier/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | unique_identifier 6 | 1.0.6 7 | 8 | ROS messages and interfaces for universally unique identifiers. 9 | 10 | Not needed for wet packages, use only to resolve dry stack 11 | dependencies. 12 | 13 | Jack O'Quin 14 | Jack O'Quin 15 | BSD 16 | http://ros.org/wiki/unique_identifier 17 | https://github.com/ros-geographic-info/unique_identifier 18 | https://github.com/ros-geographic-info/unique_identifier/issues 19 | 20 | catkin 21 | 22 | unique_id 23 | uuid_msgs 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /day5/unique_identifier/uuid_msgs/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | Change history 2 | ============== 3 | 4 | 1.0.6 (2017-04-04) 5 | ------------------ 6 | 7 | 1.0.5 (2015-04-17) 8 | ------------------ 9 | 10 | 1.0.4 (2014-04-30) 11 | ------------------ 12 | 13 | * add architecture independent tag 14 | 15 | 1.0.3 (2013-07-24) 16 | ------------------ 17 | 18 | 1.0.2 (2013-07-18) 19 | ------------------- 20 | 21 | 1.0.1 (2013-03-25) 22 | ------------------- 23 | 24 | * Hydro release update. 25 | 26 | 1.0.0 (2013-03-18) 27 | ------------------- 28 | 29 | * Hydro release. 30 | * Convert to catkin (`#1`_). 31 | 32 | 0.9.0 (2013-01-03) 33 | ------------------ 34 | 35 | * Initial release to Groovy. 36 | 37 | 0.8.0 (2012-07-19) 38 | ------------------ 39 | 40 | * Initial release to Fuerte. 41 | * Provides uuid_msgs/UniqueID message. 42 | 43 | .. _`#1`: https://github.com/ros-geographic-info/unique_identifier/issues/1 44 | -------------------------------------------------------------------------------- /day5/unique_identifier/uuid_msgs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.3) 2 | project(uuid_msgs) 3 | 4 | find_package(catkin REQUIRED COMPONENTS message_generation std_msgs) 5 | # We want boost/format.hpp, which isn't in its own component. 6 | find_package(Boost REQUIRED) 7 | 8 | add_message_files(DIRECTORY msg FILES UniqueID.msg) 9 | generate_messages(DEPENDENCIES std_msgs) 10 | 11 | catkin_package( 12 | CATKIN_DEPENDS message_runtime std_msgs 13 | DEPENDS Boost) 14 | -------------------------------------------------------------------------------- /day5/unique_identifier/uuid_msgs/mainpage.dox: -------------------------------------------------------------------------------- 1 | /** 2 | \mainpage 3 | \htmlinclude manifest.html 4 | 5 | This package contains ROS messages for universally unique identifiers (UUIDs). 6 | 7 | It does not provide any nodes, libraries or scripts. 8 | 9 | */ 10 | -------------------------------------------------------------------------------- /day5/unique_identifier/uuid_msgs/msg/UniqueID.msg: -------------------------------------------------------------------------------- 1 | # A universally unique identifier (UUID). 2 | # 3 | # http://en.wikipedia.org/wiki/Universally_unique_identifier 4 | # http://tools.ietf.org/html/rfc4122.html 5 | 6 | uint8[16] uuid 7 | -------------------------------------------------------------------------------- /day5/unique_identifier/uuid_msgs/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | uuid_msgs 6 | 1.0.6 7 | 8 | ROS messages for universally unique identifiers. 9 | 10 | Jack O'Quin 11 | Jack O'Quin 12 | BSD 13 | http://ros.org/wiki/uuid_msgs 14 | 15 | catkin 16 | 17 | message_generation 18 | 19 | std_msgs 20 | 21 | message_runtime 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /day6/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ISSUE TEMPLATE ver. 0.4.0 2 | 3 | 1. Which TurtleBot3 platform do you use? 4 | 5 | - [ ] Burger 6 | - [ ] Waffle 7 | - [ ] Waffle Pi 8 | 9 | 2. Which ROS is working with TurtleBot3? 10 | 11 | - [ ] ROS 1 Kinetic Kame 12 | - [ ] ROS 1 Melodic Morenia 13 | - [ ] ROS 1 Noetic Ninjemys 14 | - [ ] ROS 2 Dashing Diademata 15 | - [ ] ROS 2 Eloquent Elusor 16 | - [ ] ROS 2 Foxy Fitzroy 17 | - [ ] etc (Please specify your ROS Version here) 18 | 19 | 3. Which SBC(Single Board Computer) is working on TurtleBot3? 20 | 21 | - [ ] Intel Joule 570x 22 | - [ ] Raspberry Pi 3B+ 23 | - [ ] Raspberry Pi 4 24 | - [ ] etc (Please specify your SBC here) 25 | 26 | 4. Which OS you installed on SBC? 27 | 28 | - [ ] Raspbian distributed by ROBOTIS 29 | - [ ] Ubuntu MATE (16.04/18.04/20.04) 30 | - [ ] Ubuntu preinstalled server (18.04/20.04) 31 | - [ ] etc (Please specify your OS here) 32 | 33 | 5. Which OS you installed on Remote PC? 34 | 35 | - [ ] Ubuntu 16.04 LTS (Xenial Xerus) 36 | - [ ] Ubuntu 18.04 LTS (Bionic Beaver) 37 | - [ ] Ubuntu 20.04 LTS (Focal Fossa) 38 | - [ ] Windows 10 39 | - [ ] MAC OS X (Specify version) 40 | - [ ] etc (Please specify your OS here) 41 | 42 | 6. Specify the software and firmware version(Can be found from Bringup messages) 43 | 44 | - Software version: [x.x.x] 45 | - Firmware version: [x.x.x] 46 | 47 | 7. Specify the commands or instructions to reproduce the issue. 48 | 49 | - HERE 50 | 51 | 8. Copy and Paste the error messages on terminal. 52 | 53 | - HERE 54 | 55 | 9. Please describe the issue in detail. 56 | 57 | - HERE 58 | -------------------------------------------------------------------------------- /day6/out.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sr42-dev/scaling-spoon/59e86c5f2aba61d4d87731aba5b6b042f7985120/day6/out.png -------------------------------------------------------------------------------- /day6/turtlebot3/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.0.2) 2 | project(turtlebot3) 3 | find_package(catkin REQUIRED) 4 | catkin_metapackage() 5 | -------------------------------------------------------------------------------- /day6/turtlebot3/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | turtlebot3 4 | 1.2.6 5 | 6 | ROS packages for the Turtlebot3 (meta package) 7 | 8 | Apache 2.0 9 | BSD 10 | Pyo 11 | Darby Lim 12 | Gilbert 13 | HanCheol Cho 14 | Ashe Kim 15 | Leon Jung 16 | Will Son 17 | http://wiki.ros.org/turtlebot3 18 | http://turtlebot3.robotis.com 19 | https://github.com/ROBOTIS-GIT/turtlebot3 20 | https://github.com/ROBOTIS-GIT/turtlebot3/issues 21 | catkin 22 | turtlebot3_bringup 23 | turtlebot3_description 24 | turtlebot3_example 25 | turtlebot3_navigation 26 | turtlebot3_slam 27 | turtlebot3_teleop 28 | 29 | 30 | -------------------------------------------------------------------------------- /day6/turtlebot3_bringup/99-turtlebot3-cdc.rules: -------------------------------------------------------------------------------- 1 | #http://linux-tips.org/t/prevent-modem-manager-to-capture-usb-serial-devices/284/2. 2 | 3 | #cp rules /etc/udev/rules.d/ 4 | #sudo udevadm control --reload-rules 5 | #sudo udevadm trigger 6 | 7 | ATTRS{idVendor}=="0483" ATTRS{idProduct}=="5740", ENV{ID_MM_DEVICE_IGNORE}="1", MODE:="0666" 8 | ATTRS{idVendor}=="0483" ATTRS{idProduct}=="df11", MODE:="0666" 9 | ATTRS{idVendor}=="fff1" ATTRS{idProduct}=="ff48", ENV{ID_MM_DEVICE_IGNORE}="1", MODE:="0666" 10 | ATTRS{idVendor}=="10c4" ATTRS{idProduct}=="ea60", ENV{ID_MM_DEVICE_IGNORE}="1", MODE:="0666" 11 | -------------------------------------------------------------------------------- /day6/turtlebot3_bringup/camera_info/turtlebot3_rpicamera.yaml: -------------------------------------------------------------------------------- 1 | image_width: 640 2 | image_height: 480 3 | camera_name: camera 4 | camera_matrix: 5 | rows: 3 6 | cols: 3 7 | data: [322.0704122808738, 0, 199.2680620421962, 0, 320.8673986158544, 155.2533082600705, 0, 0, 1] 8 | distortion_model: plumb_bob 9 | distortion_coefficients: 10 | rows: 1 11 | cols: 5 12 | data: [0.1639958233797625, -0.271840030972792, 0.001055841660100477, -0.00166555973740089, 0] 13 | rectification_matrix: 14 | rows: 3 15 | cols: 3 16 | data: [1, 0, 0, 0, 1, 0, 0, 0, 1] 17 | projection_matrix: 18 | rows: 3 19 | cols: 4 20 | data: [329.2483825683594, 0, 198.4101510452074, 0, 0, 329.1044006347656, 155.5057121208347, 0, 0, 0, 1, 0] 21 | -------------------------------------------------------------------------------- /day6/turtlebot3_bringup/launch/includes/description.launch.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /day6/turtlebot3_bringup/launch/turtlebot3_core.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /day6/turtlebot3_bringup/launch/turtlebot3_lidar.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /day6/turtlebot3_bringup/launch/turtlebot3_model.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /day6/turtlebot3_bringup/launch/turtlebot3_realsense.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /day6/turtlebot3_bringup/launch/turtlebot3_remote.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /day6/turtlebot3_bringup/launch/turtlebot3_robot.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /day6/turtlebot3_bringup/launch/turtlebot3_rpicamera.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /day6/turtlebot3_bringup/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | turtlebot3_bringup 4 | 1.2.6 5 | 6 | roslaunch scripts for starting the TurtleBot3 7 | 8 | Apache 2.0 9 | Pyo 10 | Darby Lim 11 | Gilbert 12 | Ashe Kim 13 | Will Son 14 | http://wiki.ros.org/turtlebot3_bringup 15 | http://turtlebot3.robotis.com 16 | https://github.com/ROBOTIS-GIT/turtlebot3 17 | https://github.com/ROBOTIS-GIT/turtlebot3/issues 18 | catkin 19 | roscpp 20 | std_msgs 21 | diagnostic_msgs 22 | sensor_msgs 23 | turtlebot3_msgs 24 | turtlebot3_description 25 | turtlebot3_teleop 26 | joint_state_publisher 27 | robot_state_publisher 28 | rosserial_python 29 | hls_lfcd_lds_driver 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /day6/turtlebot3_bringup/scripts/create_udev_rules: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "" 4 | echo "This script copies a udev rule to /etc to facilitate bringing" 5 | echo "up the turtlebot3 usb connection." 6 | echo "" 7 | 8 | sudo cp `rospack find turtlebot3_bringup`/99-turtlebot3-cdc.rules /etc/udev/rules.d/ 9 | 10 | echo "" 11 | echo "Reload rules" 12 | echo "" 13 | sudo udevadm control --reload-rules 14 | sudo udevadm trigger 15 | -------------------------------------------------------------------------------- /day6/turtlebot3_description/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Set minimum required version of cmake, project name and compile options 3 | ################################################################################ 4 | cmake_minimum_required(VERSION 3.0.2) 5 | project(turtlebot3_description) 6 | 7 | ################################################################################ 8 | # Find catkin packages and libraries for catkin and system dependencies 9 | ################################################################################ 10 | find_package(catkin REQUIRED COMPONENTS 11 | urdf 12 | xacro 13 | ) 14 | 15 | ################################################################################ 16 | # Setup for python modules and scripts 17 | ################################################################################ 18 | 19 | ################################################################################ 20 | # Declare ROS messages, services and actions 21 | ################################################################################ 22 | 23 | ################################################################################ 24 | # Declare ROS dynamic reconfigure parameters 25 | ################################################################################ 26 | 27 | ################################################################################ 28 | # Declare catkin specific configuration to be passed to dependent projects 29 | ################################################################################ 30 | catkin_package( 31 | CATKIN_DEPENDS urdf xacro 32 | ) 33 | 34 | ################################################################################ 35 | # Build 36 | ################################################################################ 37 | include_directories( 38 | ${catkin_INCLUDE_DIRS} 39 | ) 40 | 41 | ################################################################################ 42 | # Install 43 | ################################################################################ 44 | install(DIRECTORY meshes rviz urdf 45 | DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} 46 | ) 47 | 48 | ################################################################################ 49 | # Test 50 | ################################################################################ 51 | -------------------------------------------------------------------------------- /day6/turtlebot3_description/meshes/sensors/astra.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sr42-dev/scaling-spoon/59e86c5f2aba61d4d87731aba5b6b042f7985120/day6/turtlebot3_description/meshes/sensors/astra.jpg -------------------------------------------------------------------------------- /day6/turtlebot3_description/meshes/sensors/lds.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sr42-dev/scaling-spoon/59e86c5f2aba61d4d87731aba5b6b042f7985120/day6/turtlebot3_description/meshes/sensors/lds.stl -------------------------------------------------------------------------------- /day6/turtlebot3_description/meshes/sensors/r200.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sr42-dev/scaling-spoon/59e86c5f2aba61d4d87731aba5b6b042f7985120/day6/turtlebot3_description/meshes/sensors/r200.jpg -------------------------------------------------------------------------------- /day6/turtlebot3_description/meshes/wheels/left_tire.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sr42-dev/scaling-spoon/59e86c5f2aba61d4d87731aba5b6b042f7985120/day6/turtlebot3_description/meshes/wheels/left_tire.stl -------------------------------------------------------------------------------- /day6/turtlebot3_description/meshes/wheels/right_tire.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sr42-dev/scaling-spoon/59e86c5f2aba61d4d87731aba5b6b042f7985120/day6/turtlebot3_description/meshes/wheels/right_tire.stl -------------------------------------------------------------------------------- /day6/turtlebot3_description/urdf/common_properties.xacro: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /day6/turtlebot3_example/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | Changelog for package turtlebot3_example 3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4 | 5 | 1.2.6 (2022-02-24) 6 | ------------------ 7 | * No Changes 8 | 9 | 1.2.5 (2020-12-30) 10 | ------------------ 11 | * No Changes 12 | 13 | 1.2.4 (2020-09-29) 14 | ------------------ 15 | * Package info updated 16 | * Contributors: Will Son 17 | 18 | 1.2.3 (2020-03-03) 19 | ------------------ 20 | * none 21 | 22 | 1.2.2 (2019-08-20) 23 | ------------------ 24 | * none 25 | 26 | 1.2.1 (2019-08-20) 27 | ------------------ 28 | * Fixed typo `#436 `_ 29 | * Contributors: Pallav Bhalla 30 | 31 | 1.2.0 (2019-01-22) 32 | ------------------ 33 | * changed math.ceil() operation `#373 `_ 34 | * fixed TypeError integers 35 | * fixed read of scanned samples when there isn't 360 36 | * Contributors: Eduardo Avelar, Gilbert, Pyo 37 | 38 | 1.1.0 (2018-07-23) 39 | ------------------ 40 | * added bringup to load multiple robot simply #251 41 | * modified topic name 42 | * deleted unused get_scan function #227 43 | * Contributors: Darby Lim, Eduardo Avelar, Gilbert, Pyo 44 | 45 | 1.0.0 (2018-05-29) 46 | ------------------ 47 | * added sensor examples 48 | * added exec python nodes like marker_server in catkin_install_python 49 | * modified global names `#211 `_ from FurqanHabibi/fix_global_topic_nam 50 | * merged pull request `#220 `_ `#212 `_ `#212 `_ `#154 `_ `#153 `_ `#147 `_ `#146 `_ `#145 `_ 51 | * Contributors: Darby Lim, Gilbert, Muhammad Furqan Habibi, Pyo 52 | 53 | 0.2.1 (2018-03-14) 54 | ------------------ 55 | * added install directory 56 | * refactoring for release 57 | * Contributors: Pyo 58 | 59 | 0.2.0 (2018-03-12) 60 | ------------------ 61 | * added example package 62 | * refactoring for release 63 | * Contributors: Gilbert, Pyo 64 | -------------------------------------------------------------------------------- /day6/turtlebot3_example/action/Turtlebot3.action: -------------------------------------------------------------------------------- 1 | # Define the goal 2 | geometry_msgs/Vector3 goal 3 | --- 4 | # Define the result 5 | string result 6 | --- 7 | # Define a feedback message 8 | string state 9 | -------------------------------------------------------------------------------- /day6/turtlebot3_example/launch/interactive_markers.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /day6/turtlebot3_example/launch/turtlebot3_bumper.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /day6/turtlebot3_example/launch/turtlebot3_client.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /day6/turtlebot3_example/launch/turtlebot3_cliff.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /day6/turtlebot3_example/launch/turtlebot3_illumination.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /day6/turtlebot3_example/launch/turtlebot3_obstacle.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /day6/turtlebot3_example/launch/turtlebot3_pointop_key.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /day6/turtlebot3_example/launch/turtlebot3_sonar.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /day6/turtlebot3_example/nodes/turtlebot3_bumper: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | ################################################################################# 3 | # Copyright 2018 ROBOTIS CO., LTD. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | ################################################################################# 17 | 18 | # Authors: Gilbert # 19 | 20 | import rospy 21 | from geometry_msgs.msg import Twist 22 | from turtlebot3_msgs.msg import SensorState 23 | 24 | class Bumper(): 25 | def __init__(self): 26 | self.cmd_pub = rospy.Publisher('cmd_vel', Twist, queue_size=1) 27 | self.bumper_sub = rospy.Subscriber('sensor_state', SensorState, self.get_bumper, queue_size = 1) 28 | self.twist = Twist() 29 | self.bumper() 30 | def get_bumper(self, sensor): 31 | self.bumper_state = sensor.bumper 32 | if self.bumper_state == 1: 33 | self.twist.linear.x = -0.1 34 | elif self.bumper_state == 2: 35 | self.twist.linear.x = 0.1 36 | 37 | def bumper(self): 38 | rate = rospy.Rate(10) 39 | self.twist.linear.x = 0.1 40 | while not rospy.is_shutdown(): 41 | self.cmd_pub.publish(self.twist) 42 | rate.sleep() 43 | 44 | def main(): 45 | rospy.init_node('turtlebot3_bumper') 46 | try: 47 | bumper = Bumper() 48 | except rospy.ROSInterruptException: 49 | pass 50 | 51 | if __name__ == '__main__': 52 | main() -------------------------------------------------------------------------------- /day6/turtlebot3_example/nodes/turtlebot3_cliff: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | ################################################################################# 3 | # Copyright 2018 ROBOTIS CO., LTD. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | ################################################################################# 17 | 18 | # Authors: Gilbert # 19 | 20 | import rospy 21 | from geometry_msgs.msg import Twist 22 | from turtlebot3_msgs.msg import SensorState 23 | 24 | class Cliff(): 25 | def __init__(self): 26 | self.cmd_pub = rospy.Publisher('cmd_vel', Twist, queue_size = 1) 27 | self.cliff_sub = rospy.Subscriber('sensor_state', SensorState, self.get_cliff, queue_size = 1) 28 | self.cliff() 29 | 30 | def get_cliff(self, sensor): 31 | twist = Twist() 32 | if sensor.cliff < 1000: 33 | linear_vel = 0 34 | else: 35 | linear_vel = 0.05 36 | 37 | twist.linear.x = linear_vel 38 | self.cmd_pub.publish(twist) 39 | 40 | def cliff(self): 41 | rate = rospy.Rate(10) 42 | while not rospy.is_shutdown(): 43 | rate.sleep() 44 | 45 | def main(): 46 | rospy.init_node('turtlebot3_cliff') 47 | try: 48 | cliff = Cliff() 49 | except rospy.ROSInterruptException: 50 | pass 51 | 52 | if __name__ == '__main__': 53 | main() 54 | 55 | -------------------------------------------------------------------------------- /day6/turtlebot3_example/nodes/turtlebot3_illumination: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | ################################################################################# 3 | # Copyright 2018 ROBOTIS CO., LTD. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | ################################################################################# 17 | 18 | # Authors: Gilbert # 19 | 20 | import rospy 21 | from geometry_msgs.msg import Twist 22 | from turtlebot3_msgs.msg import SensorState 23 | 24 | class Illumination(): 25 | def __init__(self): 26 | self.cmd_pub = rospy.Publisher('cmd_vel', Twist, queue_size=1) 27 | self.illumination_sub = rospy.Subscriber('sensor_state', SensorState, self.get_illumination, queue_size = 1) 28 | self.illumination() 29 | 30 | def get_illumination(self, sensor): 31 | twist = Twist() 32 | if sensor.illumination < 200: 33 | linear_vel = 0.05 34 | else: 35 | linear_vel = 0 36 | 37 | twist.linear.x = linear_vel 38 | self.cmd_pub.publish(twist) 39 | 40 | def illumination(self): 41 | rate = rospy.Rate(10) 42 | while not rospy.is_shutdown(): 43 | rate.sleep() 44 | 45 | def main(): 46 | rospy.init_node('turtlebot3_illumination') 47 | try: 48 | illumination = Illumination() 49 | except rospy.ROSInterruptException: 50 | pass 51 | if __name__ == '__main__': 52 | main() -------------------------------------------------------------------------------- /day6/turtlebot3_example/nodes/turtlebot3_sonar: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | ################################################################################# 3 | # Copyright 2018 ROBOTIS CO., LTD. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | ################################################################################# 17 | 18 | # Authors: Gilbert # 19 | 20 | import rospy 21 | from geometry_msgs.msg import Twist 22 | from turtlebot3_msgs.msg import SensorState 23 | 24 | class Sonar(): 25 | def __init__(self): 26 | self.cmd_pub = rospy.Publisher('cmd_vel', Twist, queue_size = 1) 27 | self.sonar_sub = rospy.Subscriber('sensor_state', SensorState, self.get_sonar, queue_size = 1) 28 | self.sonar() 29 | 30 | def get_sonar(self, sensor): 31 | twist = Twist() 32 | if sensor.sonar < 10: 33 | linear_vel = 0 34 | else: 35 | linear_vel = 0.05 36 | 37 | twist.linear.x = linear_vel 38 | self.cmd_pub.publish(twist) 39 | 40 | def sonar(self): 41 | rate = rospy.Rate(10) 42 | while not rospy.is_shutdown(): 43 | rate.sleep() 44 | 45 | def main(): 46 | rospy.init_node('turtlebot3_sonar') 47 | try: 48 | sonar = Sonar() 49 | except rospy.ROSInterruptException: 50 | pass 51 | 52 | if __name__ == '__main__': 53 | main() 54 | -------------------------------------------------------------------------------- /day6/turtlebot3_example/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | turtlebot3_example 4 | 1.2.6 5 | 6 | This package provides four TurtleBot3 basic example include move using interactive marker, move and stop using LDS, move to goal position, move to custom routes. The interactions node is that you can control the TurtleBot3 front and back side or rotate to goal position. The obstacle node is that when the robot meets an obstacle, it stops. The patrol node is that TurtleBot3 move to custom route. There are 3 route(square, triangle, circle) in this package. You can add your route and move the TurtleBot3. The pointop node is that you can insert goal position include distance x-axis, y-axis and angluar z-axis. 7 | 8 | Apache 2.0 9 | Gilbert 10 | Pyo 11 | Ashe Kim 12 | Will Son 13 | http://wiki.ros.org/turtlebot3_example 14 | http://turtlebot3.robotis.com 15 | https://github.com/ROBOTIS-GIT/turtlebot3 16 | https://github.com/ROBOTIS-GIT/turtlebot3/issues 17 | catkin 18 | rospy 19 | actionlib 20 | interactive_markers 21 | std_msgs 22 | sensor_msgs 23 | geometry_msgs 24 | nav_msgs 25 | visualization_msgs 26 | actionlib_msgs 27 | turtlebot3_msgs 28 | message_generation 29 | message_runtime 30 | message_runtime 31 | turtlebot3_bringup 32 | 33 | -------------------------------------------------------------------------------- /day6/turtlebot3_example/setup.py: -------------------------------------------------------------------------------- 1 | ## ! DO NOT MANUALLY INVOKE THIS setup.py, USE CATKIN INSTEAD 2 | ## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html 3 | 4 | from distutils.core import setup 5 | from catkin_pkg.python_setup import generate_distutils_setup 6 | 7 | # fetch values from package.xml 8 | setup_args = generate_distutils_setup( 9 | packages=['turtlebot3_example'], 10 | package_dir={'': 'src'} 11 | ) 12 | 13 | setup(**setup_args) 14 | -------------------------------------------------------------------------------- /day6/turtlebot3_example/src/turtlebot3_example/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sr42-dev/scaling-spoon/59e86c5f2aba61d4d87731aba5b6b042f7985120/day6/turtlebot3_example/src/turtlebot3_example/__init__.py -------------------------------------------------------------------------------- /day6/turtlebot3_navigation/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Set minimum required version of cmake, project name and compile options 3 | ################################################################################ 4 | cmake_minimum_required(VERSION 3.0.2) 5 | project(turtlebot3_navigation) 6 | 7 | ################################################################################ 8 | # Find catkin packages and libraries for catkin and system dependencies 9 | ################################################################################ 10 | find_package(catkin REQUIRED) 11 | 12 | ################################################################################ 13 | # Setup for python modules and scripts 14 | ################################################################################ 15 | 16 | ################################################################################ 17 | # Declare ROS messages, services and actions 18 | ################################################################################ 19 | 20 | ################################################################################ 21 | # Declare ROS dynamic reconfigure parameters 22 | ################################################################################ 23 | 24 | ################################################################################ 25 | # Declare catkin specific configuration to be passed to dependent projects 26 | ################################################################################ 27 | catkin_package() 28 | 29 | ################################################################################ 30 | # Build 31 | ################################################################################ 32 | 33 | ################################################################################ 34 | # Install 35 | ################################################################################ 36 | install(DIRECTORY launch maps param rviz 37 | DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} 38 | ) 39 | 40 | ################################################################################ 41 | # Test 42 | ################################################################################ 43 | -------------------------------------------------------------------------------- /day6/turtlebot3_navigation/launch/amcl.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /day6/turtlebot3_navigation/launch/move_base.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /day6/turtlebot3_navigation/launch/turtlebot3_navigation.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /day6/turtlebot3_navigation/maps/map.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sr42-dev/scaling-spoon/59e86c5f2aba61d4d87731aba5b6b042f7985120/day6/turtlebot3_navigation/maps/map.pgm -------------------------------------------------------------------------------- /day6/turtlebot3_navigation/maps/map.yaml: -------------------------------------------------------------------------------- 1 | image: ./map.pgm 2 | resolution: 0.050000 3 | origin: [-10.000000, -10.000000, 0.000000] 4 | negate: 0 5 | occupied_thresh: 0.65 6 | free_thresh: 0.196 7 | 8 | -------------------------------------------------------------------------------- /day6/turtlebot3_navigation/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | turtlebot3_navigation 4 | 1.2.6 5 | 6 | The turtlebot3_navigation provides roslaunch scripts for starting the navigation. 7 | 8 | Apache 2.0 9 | Pyo 10 | Darby Lim 11 | Gilbert 12 | Leon Jung 13 | Will Son 14 | http://wiki.ros.org/turtlebot3_navigation 15 | http://turtlebot3.robotis.com 16 | https://github.com/ROBOTIS-GIT/turtlebot3 17 | https://github.com/ROBOTIS-GIT/turtlebot3/issues 18 | catkin 19 | amcl 20 | map_server 21 | move_base 22 | turtlebot3_bringup 23 | 24 | -------------------------------------------------------------------------------- /day6/turtlebot3_navigation/param/base_local_planner_params.yaml: -------------------------------------------------------------------------------- 1 | TrajectoryPlannerROS: 2 | 3 | # Robot Configuration Parameters 4 | max_vel_x: 0.18 5 | min_vel_x: 0.08 6 | 7 | max_vel_theta: 1.0 8 | min_vel_theta: -1.0 9 | min_in_place_vel_theta: 1.0 10 | 11 | acc_lim_x: 1.0 12 | acc_lim_y: 0.0 13 | acc_lim_theta: 0.6 14 | 15 | # Goal Tolerance Parameters 16 | xy_goal_tolerance: 0.10 17 | yaw_goal_tolerance: 0.05 18 | 19 | # Differential-drive robot configuration 20 | holonomic_robot: false 21 | 22 | # Forward Simulation Parameters 23 | sim_time: 0.8 24 | vx_samples: 18 25 | vtheta_samples: 20 26 | sim_granularity: 0.05 27 | -------------------------------------------------------------------------------- /day6/turtlebot3_navigation/param/costmap_common_params_burger.yaml: -------------------------------------------------------------------------------- 1 | obstacle_range: 3.0 2 | raytrace_range: 3.5 3 | 4 | footprint: [[-0.105, -0.105], [-0.105, 0.105], [0.041, 0.105], [0.041, -0.105]] 5 | #robot_radius: 0.105 6 | 7 | inflation_radius: 1.0 8 | cost_scaling_factor: 3.0 9 | 10 | map_type: costmap 11 | observation_sources: scan 12 | scan: {sensor_frame: base_scan, data_type: LaserScan, topic: scan, marking: true, clearing: true} -------------------------------------------------------------------------------- /day6/turtlebot3_navigation/param/costmap_common_params_waffle.yaml: -------------------------------------------------------------------------------- 1 | obstacle_range: 3.0 2 | raytrace_range: 3.5 3 | 4 | footprint: [[-0.205, -0.155], [-0.205, 0.155], [0.077, 0.155], [0.077, -0.155]] 5 | #robot_radius: 0.17 6 | 7 | inflation_radius: 1.0 8 | cost_scaling_factor: 3.0 9 | 10 | map_type: costmap 11 | observation_sources: scan 12 | scan: {sensor_frame: base_scan, data_type: LaserScan, topic: scan, marking: true, clearing: true} 13 | -------------------------------------------------------------------------------- /day6/turtlebot3_navigation/param/costmap_common_params_waffle_pi.yaml: -------------------------------------------------------------------------------- 1 | obstacle_range: 3.0 2 | raytrace_range: 3.5 3 | 4 | footprint: [[-0.205, -0.155], [-0.205, 0.155], [0.077, 0.155], [0.077, -0.155]] 5 | #robot_radius: 0.17 6 | 7 | inflation_radius: 1.0 8 | cost_scaling_factor: 3.0 9 | 10 | map_type: costmap 11 | observation_sources: scan 12 | scan: {sensor_frame: base_scan, data_type: LaserScan, topic: scan, marking: true, clearing: true} 13 | -------------------------------------------------------------------------------- /day6/turtlebot3_navigation/param/dwa_local_planner_params_burger.yaml: -------------------------------------------------------------------------------- 1 | DWAPlannerROS: 2 | 3 | # Robot Configuration Parameters 4 | max_vel_x: 0.22 5 | min_vel_x: -0.22 6 | 7 | max_vel_y: 0.0 8 | min_vel_y: 0.0 9 | 10 | # The velocity when robot is moving in a straight line 11 | max_vel_trans: 0.22 12 | min_vel_trans: 0.11 13 | 14 | max_vel_theta: 2.75 15 | min_vel_theta: 1.37 16 | 17 | acc_lim_x: 2.5 18 | acc_lim_y: 0.0 19 | acc_lim_theta: 3.2 20 | 21 | # Goal Tolerance Parameters 22 | xy_goal_tolerance: 0.05 23 | yaw_goal_tolerance: 0.17 24 | latch_xy_goal_tolerance: false 25 | 26 | # Forward Simulation Parameters 27 | sim_time: 1.5 28 | vx_samples: 20 29 | vy_samples: 0 30 | vth_samples: 40 31 | controller_frequency: 10.0 32 | 33 | # Trajectory Scoring Parameters 34 | path_distance_bias: 32.0 35 | goal_distance_bias: 20.0 36 | occdist_scale: 0.02 37 | forward_point_distance: 0.325 38 | stop_time_buffer: 0.2 39 | scaling_speed: 0.25 40 | max_scaling_factor: 0.2 41 | 42 | # Oscillation Prevention Parameters 43 | oscillation_reset_dist: 0.05 44 | 45 | # Debugging 46 | publish_traj_pc : true 47 | publish_cost_grid_pc: true 48 | -------------------------------------------------------------------------------- /day6/turtlebot3_navigation/param/dwa_local_planner_params_waffle.yaml: -------------------------------------------------------------------------------- 1 | DWAPlannerROS: 2 | 3 | # Robot Configuration Parameters 4 | max_vel_x: 0.26 5 | min_vel_x: -0.26 6 | 7 | max_vel_y: 0.0 8 | min_vel_y: 0.0 9 | 10 | # The velocity when robot is moving in a straight line 11 | max_vel_trans: 0.26 12 | min_vel_trans: 0.13 13 | 14 | max_vel_theta: 1.82 15 | min_vel_theta: 0.9 16 | 17 | acc_lim_x: 2.5 18 | acc_lim_y: 0.0 19 | acc_lim_theta: 3.2 20 | 21 | # Goal Tolerance Parameters 22 | xy_goal_tolerance: 0.05 23 | yaw_goal_tolerance: 0.17 24 | latch_xy_goal_tolerance: false 25 | 26 | # Forward Simulation Parameters 27 | sim_time: 2.0 28 | vx_samples: 20 29 | vy_samples: 0 30 | vth_samples: 40 31 | controller_frequency: 10.0 32 | 33 | # Trajectory Scoring Parameters 34 | path_distance_bias: 32.0 35 | goal_distance_bias: 20.0 36 | occdist_scale: 0.02 37 | forward_point_distance: 0.325 38 | stop_time_buffer: 0.2 39 | scaling_speed: 0.25 40 | max_scaling_factor: 0.2 41 | 42 | # Oscillation Prevention Parameters 43 | oscillation_reset_dist: 0.05 44 | 45 | # Debugging 46 | publish_traj_pc : true 47 | publish_cost_grid_pc: true 48 | -------------------------------------------------------------------------------- /day6/turtlebot3_navigation/param/dwa_local_planner_params_waffle_pi.yaml: -------------------------------------------------------------------------------- 1 | DWAPlannerROS: 2 | 3 | # Robot Configuration Parameters 4 | max_vel_x: 0.26 5 | min_vel_x: -0.26 6 | 7 | max_vel_y: 0.0 8 | min_vel_y: 0.0 9 | 10 | # The velocity when robot is moving in a straight line 11 | max_vel_trans: 0.26 12 | min_vel_trans: 0.13 13 | 14 | max_vel_theta: 1.82 15 | min_vel_theta: 0.9 16 | 17 | acc_lim_x: 2.5 18 | acc_lim_y: 0.0 19 | acc_lim_theta: 3.2 20 | 21 | # Goal Tolerance Parameters 22 | xy_goal_tolerance: 0.05 23 | yaw_goal_tolerance: 0.17 24 | latch_xy_goal_tolerance: false 25 | 26 | # Forward Simulation Parameters 27 | sim_time: 2.0 28 | vx_samples: 20 29 | vy_samples: 0 30 | vth_samples: 40 31 | controller_frequency: 10.0 32 | 33 | # Trajectory Scoring Parameters 34 | path_distance_bias: 32.0 35 | goal_distance_bias: 20.0 36 | occdist_scale: 0.02 37 | forward_point_distance: 0.325 38 | stop_time_buffer: 0.2 39 | scaling_speed: 0.25 40 | max_scaling_factor: 0.2 41 | 42 | # Oscillation Prevention Parameters 43 | oscillation_reset_dist: 0.05 44 | 45 | # Debugging 46 | publish_traj_pc : true 47 | publish_cost_grid_pc: true 48 | -------------------------------------------------------------------------------- /day6/turtlebot3_navigation/param/global_costmap_params.yaml: -------------------------------------------------------------------------------- 1 | global_costmap: 2 | global_frame: map 3 | robot_base_frame: base_footprint 4 | 5 | update_frequency: 10.0 6 | publish_frequency: 10.0 7 | transform_tolerance: 0.5 8 | 9 | static_map: true 10 | 11 | -------------------------------------------------------------------------------- /day6/turtlebot3_navigation/param/local_costmap_params.yaml: -------------------------------------------------------------------------------- 1 | local_costmap: 2 | global_frame: odom 3 | robot_base_frame: base_footprint 4 | 5 | update_frequency: 10.0 6 | publish_frequency: 10.0 7 | transform_tolerance: 0.5 8 | 9 | static_map: false 10 | rolling_window: true 11 | width: 3 12 | height: 3 13 | resolution: 0.05 14 | 15 | -------------------------------------------------------------------------------- /day6/turtlebot3_navigation/param/move_base_params.yaml: -------------------------------------------------------------------------------- 1 | shutdown_costmaps: false 2 | controller_frequency: 10.0 3 | planner_patience: 5.0 4 | controller_patience: 15.0 5 | conservative_reset_dist: 3.0 6 | planner_frequency: 5.0 7 | oscillation_timeout: 10.0 8 | oscillation_distance: 0.2 9 | 10 | -------------------------------------------------------------------------------- /day6/turtlebot3_slam/bag/bag_files.md: -------------------------------------------------------------------------------- 1 | # Download link of bag files 2 | 3 | - [TB3_WAFFLE_SLAM.bag](https://github.com/ROBOTIS-GIT/bags) 4 | - Commands for download: 5 | ```bash 6 | roscd turtlebot3_slam/bag 7 | wget https://github.com/ROBOTIS-GIT/bags/raw/master/TB3_WAFFLE_SLAM.bag 8 | ``` 9 | -------------------------------------------------------------------------------- /day6/turtlebot3_slam/config/frontier_exploration.yaml: -------------------------------------------------------------------------------- 1 | transform_tolerance: 0.5 2 | update_frequency: 5.0 3 | publish_frequency: 5.0 4 | 5 | global_frame: map 6 | robot_base_frame: base_link 7 | resolution: 0.05 8 | 9 | rolling_window: false 10 | track_unknown_space: true 11 | 12 | plugins: 13 | - {name: static, type: "costmap_2d::StaticLayer"} 14 | - {name: explore_boundary, type: "frontier_exploration::BoundedExploreLayer"} 15 | - {name: sensor, type: "costmap_2d::ObstacleLayer"} 16 | - {name: inflation, type: "costmap_2d::InflationLayer"} 17 | 18 | static: 19 | map_topic: /map 20 | subscribe_to_updates: true 21 | 22 | explore_boundary: 23 | resize_to_boundary: false 24 | frontier_travel_point: middle 25 | explore_clear_space: false 26 | 27 | sensor: 28 | observation_sources: laser 29 | laser: {data_type: LaserScan, clearing: true, marking: true, topic: scan, inf_is_valid: true, raytrace_range: $(arg sensor_range), obstacle_range: $(arg sensor_range)} 30 | 31 | inflation: 32 | inflation_radius: 0.15 33 | -------------------------------------------------------------------------------- /day6/turtlebot3_slam/config/gmapping_params.yaml: -------------------------------------------------------------------------------- 1 | map_update_interval: 2.0 2 | maxUrange: 3.0 3 | sigma: 0.05 4 | kernelSize: 1 5 | lstep: 0.05 6 | astep: 0.05 7 | iterations: 5 8 | lsigma: 0.075 9 | ogain: 3.0 10 | lskip: 0 11 | minimumScore: 50 12 | srr: 0.1 13 | srt: 0.2 14 | str: 0.1 15 | stt: 0.2 16 | linearUpdate: 1.0 17 | angularUpdate: 0.2 18 | temporalUpdate: 0.5 19 | resampleThreshold: 0.5 20 | particles: 100 21 | xmin: -10.0 22 | ymin: -10.0 23 | xmax: 10.0 24 | ymax: 10.0 25 | delta: 0.05 26 | llsamplerange: 0.01 27 | llsamplestep: 0.01 28 | lasamplerange: 0.005 29 | lasamplestep: 0.005 30 | -------------------------------------------------------------------------------- /day6/turtlebot3_slam/config/karto_mapper_params.yaml: -------------------------------------------------------------------------------- 1 | # General Parameters 2 | use_scan_matching: true 3 | use_scan_barycenter: true 4 | minimum_travel_distance: 0.12 5 | minimum_travel_heading: 0.174 #in radians 6 | scan_buffer_size: 70 7 | scan_buffer_maximum_scan_distance: 3.5 8 | link_match_minimum_response_fine: 0.12 9 | link_scan_maximum_distance: 3.5 10 | loop_search_maximum_distance: 3.5 11 | do_loop_closing: true 12 | loop_match_minimum_chain_size: 10 13 | loop_match_maximum_variance_coarse: 0.4 # gets squared later 14 | loop_match_minimum_response_coarse: 0.8 15 | loop_match_minimum_response_fine: 0.8 16 | 17 | # Correlation Parameters - Correlation Parameters 18 | correlation_search_space_dimension: 0.3 19 | correlation_search_space_resolution: 0.01 20 | correlation_search_space_smear_deviation: 0.03 21 | 22 | # Correlation Parameters - Loop Closure Parameters 23 | loop_search_space_dimension: 8.0 24 | loop_search_space_resolution: 0.05 25 | loop_search_space_smear_deviation: 0.03 26 | 27 | # Scan Matcher Parameters 28 | distance_variance_penalty: 0.3 # gets squared later 29 | angle_variance_penalty: 0.349 # in degrees (gets converted to radians then squared) 30 | fine_search_angle_offset: 0.00349 # in degrees (gets converted to radians) 31 | coarse_search_angle_offset: 0.349 # in degrees (gets converted to radians) 32 | coarse_angle_resolution: 0.0349 # in degrees (gets converted to radians) 33 | minimum_angle_penalty: 0.9 34 | minimum_distance_penalty: 0.5 35 | use_response_expansion: false -------------------------------------------------------------------------------- /day6/turtlebot3_slam/config/turtlebot3_lds_2d.lua: -------------------------------------------------------------------------------- 1 | -- Copyright 2016 The Cartographer Authors 2 | -- 3 | -- Licensed under the Apache License, Version 2.0 (the "License"); 4 | -- you may not use this file except in compliance with the License. 5 | -- You may obtain a copy of the License at 6 | -- 7 | -- http://www.apache.org/licenses/LICENSE-2.0 8 | -- 9 | -- Unless required by applicable law or agreed to in writing, software 10 | -- distributed under the License is distributed on an "AS IS" BASIS, 11 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | -- See the License for the specific language governing permissions and 13 | -- limitations under the License. 14 | 15 | include "map_builder.lua" 16 | include "trajectory_builder.lua" 17 | 18 | options = { 19 | map_builder = MAP_BUILDER, 20 | trajectory_builder = TRAJECTORY_BUILDER, 21 | map_frame = "map", 22 | tracking_frame = "imu_link", -- imu_link, If you are using gazebo, use 'base_footprint' (libgazebo_ros_imu's bug) 23 | published_frame = "odom", 24 | odom_frame = "odom", 25 | provide_odom_frame = false, 26 | publish_frame_projected_to_2d = false, 27 | use_odometry = true, 28 | use_nav_sat = false, 29 | use_landmarks = false, 30 | num_laser_scans = 1, 31 | num_multi_echo_laser_scans = 0, 32 | num_subdivisions_per_laser_scan = 1, 33 | num_point_clouds = 0, 34 | lookup_transform_timeout_sec = 0.2, 35 | submap_publish_period_sec = 0.3, 36 | pose_publish_period_sec = 5e-3, 37 | trajectory_publish_period_sec = 30e-3, 38 | rangefinder_sampling_ratio = 1., 39 | odometry_sampling_ratio = 0.1, 40 | fixed_frame_pose_sampling_ratio = 1., 41 | imu_sampling_ratio = 0.1, 42 | landmarks_sampling_ratio = 1., 43 | } 44 | 45 | MAP_BUILDER.use_trajectory_builder_2d = true 46 | 47 | TRAJECTORY_BUILDER_2D.min_range = 0.1 48 | TRAJECTORY_BUILDER_2D.max_range = 3.5 49 | TRAJECTORY_BUILDER_2D.missing_data_ray_length = 3. 50 | TRAJECTORY_BUILDER_2D.use_imu_data = true 51 | TRAJECTORY_BUILDER_2D.use_online_correlative_scan_matching = true 52 | TRAJECTORY_BUILDER_2D.motion_filter.max_angle_radians = math.rad(0.1) 53 | 54 | POSE_GRAPH.constraint_builder.min_score = 0.65 55 | POSE_GRAPH.constraint_builder.global_localization_min_score = 0.7 56 | 57 | return options 58 | -------------------------------------------------------------------------------- /day6/turtlebot3_slam/config/turtlebot3_lds_2d_gazebo.lua: -------------------------------------------------------------------------------- 1 | -- Copyright 2016 The Cartographer Authors 2 | -- 3 | -- Licensed under the Apache License, Version 2.0 (the "License"); 4 | -- you may not use this file except in compliance with the License. 5 | -- You may obtain a copy of the License at 6 | -- 7 | -- http://www.apache.org/licenses/LICENSE-2.0 8 | -- 9 | -- Unless required by applicable law or agreed to in writing, software 10 | -- distributed under the License is distributed on an "AS IS" BASIS, 11 | -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | -- See the License for the specific language governing permissions and 13 | -- limitations under the License. 14 | 15 | include "map_builder.lua" 16 | include "trajectory_builder.lua" 17 | 18 | options = { 19 | map_builder = MAP_BUILDER, 20 | trajectory_builder = TRAJECTORY_BUILDER, 21 | map_frame = "map", 22 | tracking_frame = "base_footprint", -- imu_link, If you are using gazebo, use 'base_footprint' (libgazebo_ros_imu's bug) 23 | published_frame = "odom", 24 | odom_frame = "odom", 25 | provide_odom_frame = false, 26 | publish_frame_projected_to_2d = false, 27 | use_odometry = true, 28 | use_nav_sat = false, 29 | use_landmarks = false, 30 | num_laser_scans = 1, 31 | num_multi_echo_laser_scans = 0, 32 | num_subdivisions_per_laser_scan = 1, 33 | num_point_clouds = 0, 34 | lookup_transform_timeout_sec = 0.2, 35 | submap_publish_period_sec = 0.3, 36 | pose_publish_period_sec = 5e-3, 37 | trajectory_publish_period_sec = 30e-3, 38 | rangefinder_sampling_ratio = 1., 39 | odometry_sampling_ratio = 1., 40 | fixed_frame_pose_sampling_ratio = 1., 41 | imu_sampling_ratio = 1., 42 | landmarks_sampling_ratio = 1., 43 | } 44 | 45 | MAP_BUILDER.use_trajectory_builder_2d = true 46 | 47 | TRAJECTORY_BUILDER_2D.min_range = 0.1 48 | TRAJECTORY_BUILDER_2D.max_range = 3.5 49 | TRAJECTORY_BUILDER_2D.missing_data_ray_length = 3. 50 | TRAJECTORY_BUILDER_2D.use_imu_data = true 51 | TRAJECTORY_BUILDER_2D.use_online_correlative_scan_matching = true 52 | TRAJECTORY_BUILDER_2D.motion_filter.max_angle_radians = math.rad(0.1) 53 | 54 | POSE_GRAPH.constraint_builder.min_score = 0.65 55 | POSE_GRAPH.constraint_builder.global_localization_min_score = 0.7 56 | 57 | return options 58 | -------------------------------------------------------------------------------- /day6/turtlebot3_slam/include/turtlebot3_slam/flat_world_imu_node.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2018 ROBOTIS CO., LTD. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | *******************************************************************************/ 16 | 17 | #ifndef FLAT_WORLD_IMU_NODE_H_ 18 | #define FLAT_WORLD_IMU_NODE_H_ 19 | 20 | #include 21 | #include 22 | 23 | #define GRAVITY 9.8 24 | 25 | class FlatWorldImuNode 26 | { 27 | public: 28 | FlatWorldImuNode(); 29 | ~FlatWorldImuNode(); 30 | bool init(); 31 | 32 | private: 33 | ros::NodeHandle nh_; 34 | ros::Time last_published_time_; 35 | ros::Publisher publisher_; 36 | ros::Subscriber subscriber_; 37 | void msgCallback(const sensor_msgs::ImuConstPtr imu_in); 38 | }; 39 | 40 | #endif // FLAT_WORLD_IMU_NODE_H_ 41 | -------------------------------------------------------------------------------- /day6/turtlebot3_slam/launch/turtlebot3_cartographer.launch: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 32 | 33 | 34 | 35 | 36 | 37 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /day6/turtlebot3_slam/launch/turtlebot3_frontier_exploration.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /day6/turtlebot3_slam/launch/turtlebot3_gmapping.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /day6/turtlebot3_slam/launch/turtlebot3_karto.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /day6/turtlebot3_slam/launch/turtlebot3_manipulation_slam.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /day6/turtlebot3_slam/launch/turtlebot3_slam.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /day6/turtlebot3_slam/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | turtlebot3_slam 4 | 1.2.6 5 | 6 | The turtlebot3_slam package provides roslaunch scripts for starting the SLAM 7 | 8 | Apache 2.0 9 | Pyo 10 | Darby Lim 11 | Gilbert 12 | Leon Jung 13 | Will Son 14 | http://wiki.ros.org/turtlebot3_slam 15 | http://turtlebot3.robotis.com 16 | https://github.com/ROBOTIS-GIT/turtlebot3 17 | https://github.com/ROBOTIS-GIT/turtlebot3/issues 18 | catkin 19 | roscpp 20 | sensor_msgs 21 | turtlebot3_bringup 22 | 23 | -------------------------------------------------------------------------------- /day6/turtlebot3_slam/src/flat_world_imu_node.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 The Cartographer Authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | 19 | FlatWorldImuNode::FlatWorldImuNode() 20 | { 21 | bool init_result = init(); 22 | ROS_ASSERT(init_result); 23 | } 24 | 25 | FlatWorldImuNode::~FlatWorldImuNode() 26 | { 27 | } 28 | 29 | bool FlatWorldImuNode::init() 30 | { 31 | publisher_ = nh_.advertise("imu_out", 10); 32 | subscriber_ = nh_.subscribe("imu_in", 150, &FlatWorldImuNode::msgCallback, this); 33 | 34 | return true; 35 | } 36 | 37 | void FlatWorldImuNode::msgCallback(const sensor_msgs::ImuConstPtr imu_in) 38 | { 39 | if (last_published_time_.isZero() || imu_in->header.stamp > last_published_time_) 40 | { 41 | last_published_time_ = imu_in->header.stamp; 42 | sensor_msgs::Imu imu_out = *imu_in; 43 | imu_out.linear_acceleration.x = 0.0; 44 | imu_out.linear_acceleration.y = 0.0; 45 | imu_out.linear_acceleration.z = GRAVITY; 46 | publisher_.publish(imu_out); 47 | } 48 | } 49 | 50 | int main(int argc, char* argv[]) 51 | { 52 | ros::init(argc, argv, "flat_world_imu_node"); 53 | 54 | FlatWorldImuNode flat_world_imu_node; 55 | 56 | ros::spin(); 57 | 58 | return 0; 59 | } 60 | -------------------------------------------------------------------------------- /day6/turtlebot3_teleop/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | Changelog for package turtlebot3_teleop 3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4 | 5 | 1.2.6 (2022-02-24) 6 | ------------------ 7 | * Fix teleop_key on Windows 10 8 | * Contributors: Rushikesh Kamalapurkar 9 | 10 | 1.2.5 (2020-12-30) 11 | ------------------ 12 | * Python 2/3 compatibility fix 13 | * Contributors: Sean Yen 14 | 15 | 1.2.4 (2020-09-29) 16 | ------------------ 17 | * Package info updated 18 | * Contributors: Will Son 19 | 20 | 1.2.3 (2020-03-03) 21 | ------------------ 22 | * none 23 | 24 | 1.2.2 (2019-08-20) 25 | ------------------ 26 | * none 27 | 28 | 1.2.1 (2019-08-20) 29 | ------------------ 30 | * none 31 | 32 | 1.2.0 (2019-01-22) 33 | ------------------ 34 | * added windows port `#358 `_ 35 | * Contributors: Sean Yen, Taehun Lim 36 | 37 | 1.1.0 (2018-07-23) 38 | ------------------ 39 | * none 40 | 41 | 1.0.0 (2018-05-29) 42 | ------------------ 43 | * added constrain to limit velocity 44 | * modified initial value, profile function, limit velocity msg 45 | * modified global names `#211 `_ from FurqanHabibi/fix_global_topic_name 46 | * Contributors: Darby Lim, Muhammad Furqan Habibi, Pyo 47 | 48 | 0.2.1 (2018-03-14) 49 | ------------------ 50 | * none 51 | 52 | 0.2.0 (2018-03-12) 53 | ------------------ 54 | * refactoring for release 55 | * Contributors: Pyo 56 | 57 | 0.1.6 (2017-08-14) 58 | ------------------ 59 | * none 60 | 61 | 0.1.5 (2017-05-25) 62 | ------------------ 63 | * none 64 | 65 | 0.1.4 (2017-05-23) 66 | ------------------ 67 | * modified launch file name 68 | * added teleop package 69 | * Contributors: Darby Lim 70 | 71 | 0.1.3 (2017-04-24) 72 | ------------------ 73 | * none 74 | -------------------------------------------------------------------------------- /day6/turtlebot3_teleop/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Set minimum required version of cmake, project name and compile options 3 | ################################################################################ 4 | cmake_minimum_required(VERSION 3.0.2) 5 | project(turtlebot3_teleop) 6 | 7 | ################################################################################ 8 | # Find catkin packages and libraries for catkin and system dependencies 9 | ################################################################################ 10 | find_package(catkin REQUIRED COMPONENTS 11 | rospy 12 | geometry_msgs 13 | ) 14 | 15 | ################################################################################ 16 | # Setup for python modules and scripts 17 | ################################################################################ 18 | catkin_python_setup() 19 | 20 | ################################################################################ 21 | # Declare ROS messages, services and actions 22 | ################################################################################ 23 | 24 | ################################################################################ 25 | # Declare ROS dynamic reconfigure parameters 26 | ################################################################################ 27 | 28 | ################################################################################ 29 | # Declare catkin specific configuration to be passed to dependent projects 30 | ################################################################################ 31 | catkin_package( 32 | CATKIN_DEPENDS rospy geometry_msgs 33 | ) 34 | 35 | ################################################################################ 36 | # Build 37 | ################################################################################ 38 | 39 | ################################################################################ 40 | # Install 41 | ################################################################################ 42 | catkin_install_python(PROGRAMS 43 | nodes/turtlebot3_teleop_key 44 | DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} 45 | ) 46 | 47 | install(DIRECTORY launch 48 | DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} 49 | ) 50 | 51 | ################################################################################ 52 | # Test 53 | ################################################################################ 54 | -------------------------------------------------------------------------------- /day6/turtlebot3_teleop/launch/turtlebot3_teleop_key.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /day6/turtlebot3_teleop/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | turtlebot3_teleop 4 | 1.2.6 5 | 6 | Provides teleoperation using keyboard for TurtleBot3. 7 | 8 | BSD 9 | Melonee Wise 10 | Darby Lim 11 | Pyo 12 | Will Son 13 | http://wiki.ros.org/turtlebot3_teleop 14 | http://turtlebot3.robotis.com 15 | https://github.com/ROBOTIS-GIT/turtlebot3 16 | https://github.com/ROBOTIS-GIT/turtlebot3/issues 17 | catkin 18 | rospy 19 | geometry_msgs 20 | 21 | -------------------------------------------------------------------------------- /day6/turtlebot3_teleop/setup.py: -------------------------------------------------------------------------------- 1 | ## ! DO NOT MANUALLY INVOKE THIS setup.py, USE CATKIN INSTEAD 2 | 3 | from distutils.core import setup 4 | from catkin_pkg.python_setup import generate_distutils_setup 5 | 6 | # fetch values from package.xml 7 | setup_args = generate_distutils_setup( 8 | packages=['turtlebot3_teleop'], 9 | package_dir={'': 'src'} 10 | ) 11 | 12 | setup(**setup_args) 13 | -------------------------------------------------------------------------------- /day6/turtlebot3_teleop/src/turtlebot3_teleop/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sr42-dev/scaling-spoon/59e86c5f2aba61d4d87731aba5b6b042f7985120/day6/turtlebot3_teleop/src/turtlebot3_teleop/__init__.py -------------------------------------------------------------------------------- /day7/IO_Assignment Instructions: -------------------------------------------------------------------------------- 1 | Hey guys, for your ROS assignments, you have the following tasks to do: 2 | 1) Create your own publisher and subscriber files, with at least two publishers and two subscribers, name them broadcaster and receiver, and email them along with a screenshot of your output. 3 | 2) Use the turtlesim_cleaner.py to develop a node that makes the turtlesim move in a specific shap such as a rectangle. The more complex the shape the better. Email the code file as well as the output screenshot. 4 | 3) Finally, develop a go_to_goal function that makes the turtle move from the current position to (2,2,2). You need to use a P controller at minimum, but ideally, use a PID controller for maximum marks. Send the code along with a video of the turtle moving. Refer to turtlesim_cleaner.py for the P controller. The following links will aid you in developing a PID controller: 5 | https://robotics.stackexchange.com/questions/9786/how-do-the-pid-parameters-kp-ki-and-kd-affect-the-heading-of-a-differential 6 | https://github.com/jellevos/simple-ros-pid/blob/master/simple_pid/PID.py 7 | https://modernrobotics.northwestern.edu/nu-gm-book-resource/foundations-of-robot-motion/ 8 | https://github.com/pms67/PID 9 | https://www.youtube.com/watch?v=zOByx3Izf5U 10 | https://www.youtube.com/watch?v=qJ9v1fITeVk 11 | 12 | 13 | -------------------------------------------------------------------------------- /day7/listener.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import rospy 3 | from std_msgs.msg import String 4 | 5 | def chatter_callback(message): 6 | #get_caller_id(): Get fully resolved name of local node 7 | rospy.loginfo(rospy.get_caller_id() + "I heard %s", message.data) 8 | 9 | def listener(): 10 | 11 | # In ROS, nodes are uniquely named. If two nodes with the same 12 | # node are launched, the previous one is kicked off. The 13 | # anonymous=True flag means that rospy will choose a unique 14 | # name for our 'listener' node so that multiple listeners can 15 | # run simultaneously. 16 | rospy.init_node('listener', anonymous=True) 17 | 18 | rospy.Subscriber("chatter", String, chatter_callback) 19 | 20 | # spin() simply keeps python from exiting until this node is stopped 21 | rospy.spin() 22 | 23 | if __name__ == '__main__': 24 | listener() 25 | -------------------------------------------------------------------------------- /day7/talker.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # license removed for brevity 3 | import rospy 4 | from std_msgs.msg import String 5 | 6 | def talker(): 7 | #create a new publisher. we specify the topic name, then type of message then the queue size 8 | pub = rospy.Publisher('chatter', String, queue_size=10) 9 | #we need to initialize the node 10 | # In ROS, nodes are uniquely named. If two nodes with the same 11 | # node are launched, the previous one is kicked off. The 12 | # anonymous=True flag means that rospy will choose a unique 13 | # name for our 'talker' node 14 | rospy.init_node('talker', anonymous=True) 15 | #set the loop rate 16 | rate = rospy.Rate(1) # 1hz 17 | #keep publishing until a Ctrl-C is pressed 18 | i = 0 19 | while not rospy.is_shutdown(): 20 | hello_str = "hello world %s" % i 21 | rospy.loginfo(hello_str) 22 | pub.publish(hello_str) 23 | rate.sleep() 24 | i=i+1 25 | 26 | if __name__ == '__main__': 27 | try: 28 | talker() 29 | except rospy.ROSInterruptException: 30 | pass 31 | -------------------------------------------------------------------------------- /resources/PESU I_O Slot 14 Applied Computer Vision & Robotics Course Plan.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sr42-dev/scaling-spoon/59e86c5f2aba61d4d87731aba5b6b042f7985120/resources/PESU I_O Slot 14 Applied Computer Vision & Robotics Course Plan.pdf -------------------------------------------------------------------------------- /resources/ROSResources/2018-08-13-16-42-15.bag: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sr42-dev/scaling-spoon/59e86c5f2aba61d4d87731aba5b6b042f7985120/resources/ROSResources/2018-08-13-16-42-15.bag -------------------------------------------------------------------------------- /resources/ROSResources/action_client.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | 3 | from __future__ import print_function 4 | import rospy 5 | 6 | 7 | # Brings in the SimpleActionClient 8 | import actionlib 9 | import sys 10 | 11 | # Brings in the messages used by the fibonacci action, including the 12 | # goal message and the result message. 13 | from riotu_ros_training.msg import FibonacciAction 14 | from riotu_ros_training.msg import FibonacciGoal 15 | 16 | 17 | def fibonacci_client(): 18 | # Creates the SimpleActionClient, passing the type of the action 19 | # (FibonacciAction) to the constructor. 20 | client = actionlib.SimpleActionClient('fibonacci', FibonacciAction) 21 | 22 | # Waits until the action server has started up and started 23 | # listening for goals. 24 | client.wait_for_server() 25 | 26 | # Creates a goal to send to the action server. 27 | goal = FibonacciGoal(order=20) 28 | 29 | # Sends the goal to the action server. 30 | client.send_goal(goal) 31 | 32 | # Waits for the server to finish performing the action. 33 | client.wait_for_result() 34 | 35 | # Prints out the result of executing the action 36 | return client.get_result() # A FibonacciResult 37 | 38 | if __name__ == '__main__': 39 | try: 40 | # Initializes a rospy node so that the SimpleActionClient can 41 | # publish and subscribe over ROS. 42 | rospy.init_node('fibonacci_client_py') 43 | result = fibonacci_client() 44 | print("Result:", ', '.join([str(n) for n in result.sequence])) 45 | except rospy.ROSInterruptException: 46 | print("program interrupted before completion", file=sys.stderr) -------------------------------------------------------------------------------- /resources/ROSResources/action_server.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | 3 | import rospy 4 | 5 | from actionlib import SimpleActionServer 6 | 7 | from riotu_ros_training.msg import FibonacciFeedback 8 | from riotu_ros_training.msg import FibonacciResult 9 | from riotu_ros_training.msg import FibonacciAction 10 | 11 | class FibonacciActionServer(object): 12 | # create messages that are used to publish feedback/result 13 | feedback = FibonacciFeedback() 14 | result = FibonacciResult() 15 | 16 | def __init__(self, name): 17 | self.action_name = name 18 | self.action_server = SimpleActionServer(self.action_name, FibonacciAction, execute_cb=self.execute_cb, auto_start = False) 19 | self.action_server.start() 20 | 21 | def execute_cb(self, goal): 22 | # helper variables 23 | r = rospy.Rate(1) 24 | success = True 25 | 26 | # append the seeds for the fibonacci sequence 27 | self.feedback.sequence = [] 28 | self.feedback.sequence.append(0) 29 | self.feedback.sequence.append(1) 30 | 31 | # publish info to the console for the user 32 | rospy.loginfo('%s: Executing, creating fibonacci sequence of order %i with seeds %i, %i' % (self.action_name, goal.order, self.feedback.sequence[0], self.feedback.sequence[1])) 33 | 34 | # start executing the action 35 | for i in range(1, goal.order): 36 | # check that preempt has not been requested by the client 37 | if self.action_server.is_preempt_requested(): 38 | rospy.loginfo('%s: Preempted' % self.action_name) 39 | self.action_server.set_preempted() 40 | success = False 41 | break 42 | self.feedback.sequence.append(self.feedback.sequence[i] + self.feedback.sequence[i-1]) 43 | # publish the feedback 44 | rospy.loginfo('publishing feedback ...') 45 | self.action_server.publish_feedback(self.feedback) 46 | # this step is not necessary, the sequence is computed at 1 Hz for demonstration purposes 47 | r.sleep() 48 | 49 | if success: 50 | self.result.sequence = self.feedback.sequence 51 | rospy.loginfo('%s: Succeeded' % self.action_name) 52 | self.action_server.set_succeeded(self.result) 53 | 54 | if __name__ == '__main__': 55 | rospy.init_node('fibonacci') 56 | server = FibonacciActionServer(rospy.get_name()) 57 | rospy.spin() -------------------------------------------------------------------------------- /resources/ROSResources/add_client.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import sys 4 | import rospy 5 | from ros_essentials_cpp.srv import AddTwoInts 6 | from ros_essentials_cpp.srv import AddTwoIntsRequest 7 | from ros_essentials_cpp.srv import AddTwoIntsResponse 8 | 9 | def add_two_ints_client(x, y): 10 | rospy.wait_for_service('add_two_ints') 11 | try: 12 | add_two_ints = rospy.ServiceProxy('add_two_ints', AddTwoInts) 13 | resp1 = add_two_ints(x, y) 14 | return resp1.sum 15 | except rospy.ServiceException(e): 16 | print ("Service call failed: %s"%e) 17 | 18 | def usage(): 19 | return 20 | 21 | if __name__ == "__main__": 22 | if len(sys.argv) == 3: 23 | x = int(sys.argv[1]) 24 | y = int(sys.argv[2]) 25 | else: 26 | print ("%s [x y]"%sys.argv[0]) 27 | sys.exit(1) 28 | print ("Requesting %s+%s"%(x, y)) 29 | s = add_two_ints_client(x, y) 30 | print ("%s + %s = %s"%(x, y, s)) 31 | -------------------------------------------------------------------------------- /resources/ROSResources/add_server.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from ros_essentials_cpp.srv import AddTwoInts 4 | from ros_essentials_cpp.srv import AddTwoIntsRequest 5 | from ros_essentials_cpp.srv import AddTwoIntsResponse 6 | 7 | import rospy 8 | 9 | def handle_add_two_ints(req): 10 | print ("Returning [%s + %s = %s]"%(req.a, req.b, (req.a + req.b))) 11 | return AddTwoIntsResponse(req.a + req.b) 12 | 13 | def add_two_ints_server(): 14 | rospy.init_node('add_two_ints_server') 15 | s = rospy.Service('add_two_ints', AddTwoInts, handle_add_two_ints) 16 | print ("Ready to add two ints.") 17 | rospy.spin() 18 | 19 | if __name__ == "__main__": 20 | add_two_ints_server() 21 | -------------------------------------------------------------------------------- /resources/ROSResources/color_filtering.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import numpy as np 4 | import cv2 5 | import imutils 6 | 7 | image = cv2.imread("images/tennisball05.jpg") 8 | cv2.imshow("Original",image) 9 | 10 | #convert the image into the HSV color space 11 | hsv = cv2.cvtColor(image, cv2.COLOR_BGR2HSV) 12 | cv2.imshow("hsv image",hsv) 13 | 14 | #find the upper and lower bounds of the yellow color (tennis ball) 15 | yellowLower =(30, 150, 100) 16 | yellowUpper = (50, 255, 255) 17 | 18 | #define a mask using the lower and upper bounds of the yellow color 19 | mask = cv2.inRange(hsv, yellowLower, yellowUpper) 20 | 21 | cv2.imshow("mask image", mask) 22 | 23 | cv2.waitKey(0) 24 | cv2.destroyAllWindows() 25 | 26 | 27 | 28 | cv2.waitKey(0) 29 | cv2.destroyAllWindows() -------------------------------------------------------------------------------- /resources/ROSResources/contours_detection.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import numpy as np 4 | import cv2 5 | 6 | def read_rgb_image(image_name, show): 7 | rgb_image = cv2.imread(image_name) 8 | if show: 9 | cv2.imshow("RGB Image",rgb_image) 10 | return rgb_image 11 | 12 | def convert_rgb_to_gray(rgb_image,show): 13 | gray_image = cv2.cvtColor(rgb_image, cv2.COLOR_BGR2GRAY) 14 | if show: 15 | cv2.imshow("Gray Image",gray_image) 16 | return gray_image 17 | 18 | def convert_gray_to_binary(gray_image, adaptive, show): 19 | if adaptive: 20 | binary_image = cv2.adaptiveThreshold(gray_image, 21 | 255, 22 | cv2.ADAPTIVE_THRESH_GAUSSIAN_C, 23 | cv2.THRESH_BINARY_INV, 115, 2) 24 | else: 25 | _,binary_image = cv2.threshold(gray_image,127,255,cv2.THRESH_BINARY_INV) 26 | if show: 27 | cv2.imshow("Binary Image", binary_image) 28 | return binary_image 29 | 30 | def getContours(binary_image): 31 | contours, hierarchy = cv2.findContours(binary_image, 32 | cv2.RETR_TREE, 33 | cv2.CHAIN_APPROX_SIMPLE) 34 | return contours 35 | 36 | def draw_contours(image, contours, image_name): 37 | index = -1 #means all contours 38 | thickness = 2 #thinkess of the contour line 39 | color = (255, 0, 255) #color of the contour line 40 | cv2.drawContours(image, contours, index, color, thickness) 41 | cv2.imshow(image_name,image) 42 | 43 | 44 | 45 | def main(): 46 | image_name = "images/tomato.jpg" 47 | rgb_image = read_rgb_image(image_name, True) 48 | gray_image= convert_rgb_to_gray(rgb_image,True) 49 | binary_image = convert_gray_to_binary(gray_image, True, True) 50 | contours = getContours(binary_image) 51 | draw_contours(rgb_image, contours,"RGB Contours") 52 | 53 | cv2.waitKey(0) 54 | cv2.destroyAllWindows() 55 | 56 | if __name__ == '__main__': 57 | main() 58 | -------------------------------------------------------------------------------- /resources/ROSResources/depth_image_to_laser.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /resources/ROSResources/hector_gazebo/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | Changelog for package hector_gazebo 3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4 | 5 | 0.5.1 (2018-06-29) 6 | ------------------ 7 | 8 | 0.5.0 (2016-06-24) 9 | ------------------ 10 | 11 | 0.4.1 (2016-06-24) 12 | ------------------ 13 | 14 | 0.4.0 (2015-11-07) 15 | ------------------ 16 | 17 | 0.3.8 (2016-06-24) 18 | ------------------ 19 | 20 | 0.3.7 (2015-11-07) 21 | ------------------ 22 | 23 | 0.3.6 (2015-03-21) 24 | ------------------ 25 | 26 | 0.3.5 (2015-02-23) 27 | ------------------ 28 | 29 | 0.3.4 (2014-09-01) 30 | ------------------ 31 | * Removed package gazebo_rtt_plugin 32 | This package is obsolete. Use the rtt_gazebo stack instead. 33 | * Contributors: Johannes Meyer 34 | 35 | 0.3.3 (2014-05-27) 36 | ------------------ 37 | 38 | 0.3.2 (2014-03-30) 39 | ------------------ 40 | * Made hector_gazebo and hector_sensors_gazebo true metapackages 41 | * Contributors: Johannes Meyer 42 | 43 | 0.3.1 (2013-09-23) 44 | ------------------ 45 | 46 | 0.3.0 (2013-09-02) 47 | ------------------ 48 | * Catkinization of stack hector_gazebo 49 | -------------------------------------------------------------------------------- /resources/ROSResources/hector_gazebo/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.3) 2 | project(hector_gazebo) 3 | find_package(catkin REQUIRED) 4 | catkin_metapackage() 5 | -------------------------------------------------------------------------------- /resources/ROSResources/hector_gazebo/package.xml: -------------------------------------------------------------------------------- 1 | 2 | hector_gazebo 3 | 0.5.1 4 | hector_gazebo provides packages related to to simulation of robots using gazebo (gazebo plugins, world files etc.) 5 | Johannes Meyer 6 | 7 | BSD 8 | 9 | http://ros.org/wiki/hector_gazebo 10 | 11 | 12 | Stefan Kohlbrecher 13 | Johannes Meyer 14 | 15 | 16 | catkin 17 | 18 | 19 | hector_gazebo_thermal_camera 20 | hector_gazebo_worlds 21 | hector_gazebo_plugins 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /resources/ROSResources/hector_gazebo_plugins/cfg/GNSS.cfg: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | PACKAGE = "hector_gazebo_plugins" 3 | 4 | from dynamic_reconfigure.parameter_generator_catkin import * 5 | 6 | gen = ParameterGenerator() 7 | 8 | gen.add("STATUS_FIX", bool_t, 1, "unaugmented fix", True) 9 | gen.add("STATUS_SBAS_FIX", bool_t, 1, "fix with satellite-based augmentation", False) 10 | gen.add("STATUS_GBAS_FIX", bool_t, 1, "with ground-based augmentation", False) 11 | 12 | gen.add("SERVICE_GPS", bool_t, 1, "GPS service", True) 13 | gen.add("SERVICE_GLONASS", bool_t, 1, "GLONASS service", True) 14 | gen.add("SERVICE_COMPASS", bool_t, 1, "COMPASS service", True) 15 | gen.add("SERVICE_GALILEO", bool_t, 1, "GALILEO service", True) 16 | 17 | exit(gen.generate(PACKAGE, "hector_gazebo_plugins", "GNSS")) 18 | -------------------------------------------------------------------------------- /resources/ROSResources/hector_gazebo_plugins/cfg/SensorModel.cfg: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | PACKAGE = "hector_gazebo_plugins" 3 | 4 | from dynamic_reconfigure.parameter_generator_catkin import * 5 | 6 | gen = ParameterGenerator() 7 | 8 | gen.add("gaussian_noise", double_t, 1, "Standard deviation of the additive white Gaussian noise", 0.0, 0.0, 10.0) 9 | gen.add("offset", double_t, 1, "Zero-offset of the published sensor signal", 0.0, -10.0, 10.0) 10 | gen.add("drift", double_t, 1, "Standard deviation of the sensor drift", 0.0, 0.0, 10.0) 11 | gen.add("drift_frequency", double_t, 1, "Reciprocal of the time constant of the first-order drift model in Hz", 0.0, 0.0, 1.0) 12 | gen.add("scale_error", double_t, 1, "Scale error", 1.0, 0.0, 2.0) 13 | 14 | exit(gen.generate(PACKAGE, "hector_gazebo_plugins", "SensorModel")) 15 | -------------------------------------------------------------------------------- /resources/ROSResources/hector_gazebo_plugins/package.xml: -------------------------------------------------------------------------------- 1 | 2 | hector_gazebo_plugins 3 | 0.5.1 4 | hector_gazebo_plugins provides gazebo plugins from Team Hector. 5 | Currently it contains a 6wd differential drive plugin, an IMU sensor plugin, 6 | an earth magnetic field sensor plugin, a GPS sensor plugin and a 7 | sonar ranger plugin. 8 | Johannes Meyer 9 | 10 | BSD 11 | 12 | http://ros.org/wiki/hector_gazebo_plugins 13 | 14 | 15 | Stefan Kohlbrecher 16 | Johannes Meyer 17 | 18 | 19 | catkin 20 | 21 | 22 | roscpp 23 | gazebo_dev 24 | std_msgs 25 | std_srvs 26 | geometry_msgs 27 | nav_msgs 28 | tf 29 | dynamic_reconfigure 30 | message_generation 31 | 32 | 33 | roscpp 34 | gazebo 35 | gazebo_ros 36 | std_msgs 37 | std_srvs 38 | geometry_msgs 39 | nav_msgs 40 | tf 41 | dynamic_reconfigure 42 | message_runtime 43 | 44 | 45 | -------------------------------------------------------------------------------- /resources/ROSResources/hector_gazebo_plugins/srv/SetBias.srv: -------------------------------------------------------------------------------- 1 | geometry_msgs/Vector3 bias 2 | --- 3 | -------------------------------------------------------------------------------- /resources/ROSResources/hector_gazebo_thermal_camera/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | Changelog for package hector_gazebo_thermal_camera 3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4 | 5 | 0.5.1 (2018-06-29) 6 | ------------------ 7 | * Merge pull request `#44 `_ from esteve/gazebo8 8 | Use Gazebo 8 APIs to avoid deprecation warnings. 9 | * hector_gazebo_plugins/hector_gazebo_thermal_camera: removed catkin_package(DEPENDS gazebo) declaration which was a no-op anyway 10 | See https://github.com/ros-simulation/gazebo_ros_pkgs/pull/537. 11 | * Contributors: Esteve Fernandez, Johannes Meyer 12 | 13 | 0.5.0 (2016-06-24) 14 | ------------------ 15 | * Updated gazebo dependencies to version 7 for kinetic release 16 | * hector_gazebo_thermal_camera: get rid of unused dependencies nodelet, dynamic_reconfigure, driver_base and image_transport 17 | * Contributors: Johannes Meyer 18 | 19 | 0.4.1 (2016-06-24) 20 | ------------------ 21 | * see 0.3.8 22 | 23 | 0.4.0 (2015-11-07) 24 | ------------------ 25 | * Added proper dependencies for jade and gazebo5. Now compiles and works for gazebo5 26 | * Contributors: L0g1x 27 | 28 | 0.3.8 (2016-06-24) 29 | ------------------ 30 | * Compatible with gazebo7 31 | * Add Cmake flags for C++11 32 | * Contributors: Nate Koenig, Romain Reignier 33 | 34 | 0.3.7 (2015-11-07) 35 | ------------------ 36 | * hector_gazebo_plugins/hector_gazebo_thermal_camera: switch to cmake configuration for gazebo and added OGRE include directories required for CameraPlugin.hh 37 | * Contributors: Johannes Meyer 38 | 39 | 0.3.6 (2015-03-21) 40 | ------------------ 41 | 42 | 0.3.5 (2015-02-23) 43 | ------------------ 44 | 45 | 0.3.4 (2014-09-01) 46 | ------------------ 47 | 48 | 0.3.3 (2014-05-27) 49 | ------------------ 50 | * Fix bad bug with index access 51 | * Contributors: Stefan Kohlbrecher 52 | 53 | 0.3.2 (2014-03-30) 54 | ------------------ 55 | * added missing dependency to roscpp 56 | * hector_gazebo: deleted deprecated export sections from package.xml files 57 | * Contributors: Johannes Meyer 58 | 59 | 0.3.1 (2013-09-23) 60 | ------------------ 61 | * fixed image_connect_count_ compile issues with the latest gazebo_plugins version 2.3.2 62 | 63 | 0.3.0 (2013-09-02) 64 | ------------------ 65 | * Catkinization of stack hector_gazebo 66 | -------------------------------------------------------------------------------- /resources/ROSResources/hector_gazebo_thermal_camera/package.xml: -------------------------------------------------------------------------------- 1 | 2 | hector_gazebo_thermal_camera 3 | 0.5.1 4 | hector_gazebo_thermal_camera provides a gazebo plugin that produces simulated thermal camera images. The plugin uses modified code from the gazebo_ros_camera plugin. 5 | Johannes Meyer 6 | 7 | BSD 8 | 9 | http://ros.org/wiki/hector_gazebo_thermal_camera 10 | 11 | 12 | Stefan Kohlbrecher 13 | 14 | 15 | catkin 16 | 17 | 18 | roscpp 19 | gazebo_plugins 20 | 21 | 22 | roscpp 23 | gazebo 24 | gazebo_plugins 25 | 26 | 27 | -------------------------------------------------------------------------------- /resources/ROSResources/hector_gazebo_thermal_camera/src/gazebo_ros_thermal_camera_plugin.cpp: -------------------------------------------------------------------------------- 1 | //================================================================================================= 2 | // Copyright (c) 2013, Johannes Meyer, TU Darmstadt 3 | // All rights reserved. 4 | 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above copyright 10 | // notice, this list of conditions and the following disclaimer in the 11 | // documentation and/or other materials provided with the distribution. 12 | // * Neither the name of the Flight Systems and Automatic Control group, 13 | // TU Darmstadt, nor the names of its contributors may be used to 14 | // endorse or promote products derived from this software without 15 | // specific prior written permission. 16 | 17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 21 | // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | //================================================================================================= 28 | 29 | #include "gazebo_ros_thermal_camera.cpp" 30 | 31 | // gazebo stuff 32 | #include 33 | 34 | namespace gazebo 35 | { 36 | 37 | template <> 38 | void GazeboRosThermalCamera_::LoadImpl(sensors::SensorPtr _parent, sdf::ElementPtr _sdf) 39 | { 40 | this->camera_ = this->CameraPlugin::camera; 41 | } 42 | 43 | template class GazeboRosThermalCamera_; 44 | typedef GazeboRosThermalCamera_ GazeboRosThermalCamera; 45 | 46 | // Register this plugin with the simulator 47 | GZ_REGISTER_SENSOR_PLUGIN(GazeboRosThermalCamera) 48 | 49 | } 50 | -------------------------------------------------------------------------------- /resources/ROSResources/hector_gazebo_thermal_camera/src/gazebo_ros_thermal_depth_camera_plugin.cpp: -------------------------------------------------------------------------------- 1 | //================================================================================================= 2 | // Copyright (c) 2013, Johannes Meyer, TU Darmstadt 3 | // All rights reserved. 4 | 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above copyright 10 | // notice, this list of conditions and the following disclaimer in the 11 | // documentation and/or other materials provided with the distribution. 12 | // * Neither the name of the Flight Systems and Automatic Control group, 13 | // TU Darmstadt, nor the names of its contributors may be used to 14 | // endorse or promote products derived from this software without 15 | // specific prior written permission. 16 | 17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 21 | // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | //================================================================================================= 28 | 29 | #include "gazebo_ros_thermal_camera.cpp" 30 | 31 | // gazebo stuff 32 | #include 33 | 34 | namespace gazebo 35 | { 36 | 37 | template <> 38 | void GazeboRosThermalCamera_::LoadImpl(sensors::SensorPtr _parent, sdf::ElementPtr _sdf) 39 | { 40 | this->camera_ = this->DepthCameraPlugin::depthCamera; 41 | } 42 | 43 | template class GazeboRosThermalCamera_; 44 | typedef GazeboRosThermalCamera_ GazeboRosThermalCamera; 45 | 46 | // Register this plugin with the simulator 47 | GZ_REGISTER_SENSOR_PLUGIN(GazeboRosThermalCamera) 48 | 49 | } 50 | -------------------------------------------------------------------------------- /resources/ROSResources/hector_gazebo_worlds/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.3) 2 | project(hector_gazebo_worlds) 3 | 4 | ## Find catkin macros and libraries 5 | ## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz) 6 | ## is used, also find other catkin packages 7 | find_package(catkin REQUIRED) 8 | 9 | ################################### 10 | ## catkin specific configuration ## 11 | ################################### 12 | ## The catkin_package macro generates cmake config files for your package 13 | ## Declare things to be passed to dependent projects 14 | ## INCLUDE_DIRS: uncomment this if you package contains header files 15 | ## LIBRARIES: libraries you create in this project that dependent projects also need 16 | ## CATKIN_DEPENDS: catkin_packages dependent projects also need 17 | ## DEPENDS: system dependencies of this project that dependent projects also need 18 | catkin_package( 19 | DEPENDS 20 | CATKIN_DEPENDS 21 | INCLUDE_DIRS 22 | LIBRARIES 23 | ) 24 | 25 | ############# 26 | ## Install ## 27 | ############# 28 | 29 | # all install targets should use catkin DESTINATION variables 30 | # See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html 31 | 32 | # Mark other files for installation (e.g. launch and bag files, etc.) 33 | install(DIRECTORY 34 | launch 35 | maps 36 | Media 37 | worlds 38 | DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} 39 | ) 40 | -------------------------------------------------------------------------------- /resources/ROSResources/hector_gazebo_worlds/Media/models/drc_qual4_block.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sr42-dev/scaling-spoon/59e86c5f2aba61d4d87731aba5b6b042f7985120/resources/ROSResources/hector_gazebo_worlds/Media/models/drc_qual4_block.stl -------------------------------------------------------------------------------- /resources/ROSResources/hector_gazebo_worlds/Media/models/sick_robot_day_2014_inner_block.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sr42-dev/scaling-spoon/59e86c5f2aba61d4d87731aba5b6b042f7985120/resources/ROSResources/hector_gazebo_worlds/Media/models/sick_robot_day_2014_inner_block.stl -------------------------------------------------------------------------------- /resources/ROSResources/hector_gazebo_worlds/Media/models/sick_robot_day_2014_target.stl: -------------------------------------------------------------------------------- 1 | Exported from Blender-2.71 (sub 0) -------------------------------------------------------------------------------- /resources/ROSResources/hector_gazebo_worlds/Media/models/sick_robot_panel.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sr42-dev/scaling-spoon/59e86c5f2aba61d4d87731aba5b6b042f7985120/resources/ROSResources/hector_gazebo_worlds/Media/models/sick_robot_panel.stl -------------------------------------------------------------------------------- /resources/ROSResources/hector_gazebo_worlds/Media/models/sick_robot_panel_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sr42-dev/scaling-spoon/59e86c5f2aba61d4d87731aba5b6b042f7985120/resources/ROSResources/hector_gazebo_worlds/Media/models/sick_robot_panel_0.png -------------------------------------------------------------------------------- /resources/ROSResources/hector_gazebo_worlds/Media/models/sick_robot_panel_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sr42-dev/scaling-spoon/59e86c5f2aba61d4d87731aba5b6b042f7985120/resources/ROSResources/hector_gazebo_worlds/Media/models/sick_robot_panel_1.png -------------------------------------------------------------------------------- /resources/ROSResources/hector_gazebo_worlds/Media/models/sick_robot_panel_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sr42-dev/scaling-spoon/59e86c5f2aba61d4d87731aba5b6b042f7985120/resources/ROSResources/hector_gazebo_worlds/Media/models/sick_robot_panel_2.png -------------------------------------------------------------------------------- /resources/ROSResources/hector_gazebo_worlds/Media/models/sick_robot_panel_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sr42-dev/scaling-spoon/59e86c5f2aba61d4d87731aba5b6b042f7985120/resources/ROSResources/hector_gazebo_worlds/Media/models/sick_robot_panel_3.png -------------------------------------------------------------------------------- /resources/ROSResources/hector_gazebo_worlds/Media/models/sick_robot_panel_7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sr42-dev/scaling-spoon/59e86c5f2aba61d4d87731aba5b6b042f7985120/resources/ROSResources/hector_gazebo_worlds/Media/models/sick_robot_panel_7.png -------------------------------------------------------------------------------- /resources/ROSResources/hector_localization/README.md: -------------------------------------------------------------------------------- 1 | # hector_localization 2 | The hector_localization stack is a collection of packages, that provide the full 6DOF pose of a robot or platform. 3 | 4 | Team Hector Darmstadt uses the stack to estimate the full 6D pose of the robot within the real-time loop of the Hector quadrotor and even for estimating the position, velocity and attitude of a small airplane as part of our flight mechanics lab. 5 | 6 | The design goals have been similar to what Chad Rockey described in his answer. 7 | 8 | The core package currently provides a system model for generic 6DOF rigid body pose estimation based on pure IMU inputs (rates and accelerations), which can be specialized depending on the robot and for additional input values. As measurement models the package currently provides direct and barometric height measurements, GPS postion and velocity, magnetic field sensors as heading reference and a generic pose and twist measurement to fuse nav_msgs/Odometry messages from arbitrary sources (e.g. wheel odometry or SLAM). 9 | 10 | The stack consists of a core library without dependencies to ROS beside message types and additional packages providing a node, nodelet or Orocos Real-Time Toolkit TaskContext interface. The system and measurement models could also be implemented and loaded as plugins with some minor modifications. In the background an Extended Kalman Filter based on the Bayesian Filter Library is responsible for fusing all information into a consistent state estimate and additionally keeps track which state variables are observable and which are not. 11 | 12 | 13 | # How to run the code 14 | cd catkin_ws 15 | git clone git@github.com:tu-darmstadt-ros-pkg/hector_localization.git 16 | catkin_make --source hector_localization 17 | roslaunch hector_pose_estimation hector_pose_estimation.launch 18 | 19 | #rosbag for test 20 | 1. download the rosbag 21 | 22 | https://drive.google.com/folderview?id=0B4hFvojO5r3scWJRVWdhSmdLd0k&usp=sharing 23 | 24 | 2. replay the rosbag 25 | 26 | rosbag play 2016-03-09-22-11-07.bag 27 | 28 | ![hector_pose_estimation](https://cloud.githubusercontent.com/assets/3192355/14065311/5b968b2c-f457-11e5-862a-2f42720035b8.png) -------------------------------------------------------------------------------- /resources/ROSResources/hector_localization/hector_localization/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | Changelog for package hector_localization 3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4 | 5 | 0.4.0 (2021-02-16) 6 | ------------------ 7 | * Update maintainer email address 8 | * Increase minimum CMake version to 3.0.2 to avoid the CMP0048 warning 9 | See 10 | http://wiki.ros.org/noetic/Migration#Increase_required_CMake_version_to_avoid_author_warning 11 | for details. 12 | * Contributors: Johannes Meyer 13 | 14 | 0.3.0 (2016-06-27) 15 | ------------------ 16 | 17 | 0.2.2 (2016-06-24) 18 | ------------------ 19 | 20 | 0.2.1 (2015-11-08) 21 | ------------------ 22 | 23 | 0.2.0 (2015-02-22) 24 | ------------------ 25 | 26 | 0.1.5 (2014-10-02) 27 | ------------------ 28 | 29 | 0.1.4 (2014-08-28) 30 | ------------------ 31 | * Removed package world_magnetic_model as it is currently not used by hector_pose_estimation 32 | The package is still available in the world_magnetic_model branch. 33 | * Contributors: Johannes Meyer 34 | 35 | 0.1.3 (2014-07-09) 36 | ------------------ 37 | 38 | 0.1.2 (2014-06-02) 39 | ------------------ 40 | 41 | 0.1.1 (2014-03-30) 42 | ------------------ 43 | * made hector_localization a true metapackage 44 | * Contributors: Johannes Meyer 45 | 46 | 0.1.0 (2013-09-03) 47 | ------------------ 48 | * catkinized stack hector_localization 49 | -------------------------------------------------------------------------------- /resources/ROSResources/hector_localization/hector_localization/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.0.2) 2 | project(hector_localization) 3 | find_package(catkin REQUIRED) 4 | catkin_metapackage() 5 | -------------------------------------------------------------------------------- /resources/ROSResources/hector_localization/hector_localization/package.xml: -------------------------------------------------------------------------------- 1 | 2 | hector_localization 3 | 0.4.0 4 | 5 | The hector_localization stack is a collection of packages, that provide the full 6DOF pose of a robot or platform. 6 | It uses various sensor sources, which are fused using an Extended Kalman filter. 7 | 8 | Acceleration and angular rates from an inertial measurement unit (IMU) serve as primary measurements. 9 | The usage of other sensors is application-dependent. The hector_localization stack currently supports 10 | GPS, magnetometer, barometric pressure sensors and other external sources that provide a geometry_msgs/PoseWithCovariance 11 | message via the poseupdate topic. 12 | 13 | Johannes Meyer 14 | 15 | BSD 16 | 17 | http://ros.org/wiki/hector_localization 18 | 19 | 20 | Johannes Meyer 21 | 22 | 23 | catkin 24 | 25 | 26 | message_to_tf 27 | 28 | hector_pose_estimation 29 | hector_pose_estimation_core 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /resources/ROSResources/hector_localization/hector_pose_estimation/hector_pose_estimation_nodelets.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | This nodelet initializes the pose estimation filter with a generic system model driven by IMU measurements only. 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /resources/ROSResources/hector_localization/hector_pose_estimation/launch/hector_pose_estimation.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /resources/ROSResources/hector_localization/hector_pose_estimation/package.xml: -------------------------------------------------------------------------------- 1 | 2 | hector_pose_estimation 3 | 0.4.0 4 | 5 | hector_pose_estimation provides the hector_pose_estimation node and the hector_pose_estimation nodelet. 6 | 7 | Johannes Meyer 8 | 9 | BSD 10 | 11 | http://ros.org/wiki/hector_pose_estimation 12 | 13 | 14 | Johannes Meyer 15 | 16 | 17 | catkin 18 | 19 | 20 | hector_pose_estimation_core 21 | nodelet 22 | sensor_msgs 23 | geometry_msgs 24 | nav_msgs 25 | tf 26 | message_filters 27 | 28 | 29 | hector_pose_estimation_core 30 | nodelet 31 | sensor_msgs 32 | geometry_msgs 33 | nav_msgs 34 | tf 35 | message_filters 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /resources/ROSResources/hector_localization/hector_pose_estimation/src/main.cpp: -------------------------------------------------------------------------------- 1 | //================================================================================================= 2 | // Copyright (c) 2012, Johannes Meyer, TU Darmstadt 3 | // All rights reserved. 4 | 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions are met: 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above copyright 10 | // notice, this list of conditions and the following disclaimer in the 11 | // documentation and/or other materials provided with the distribution. 12 | // * Neither the name of the Flight Systems and Automatic Control group, 13 | // TU Darmstadt, nor the names of its contributors may be used to 14 | // endorse or promote products derived from this software without 15 | // specific prior written permission. 16 | 17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 21 | // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | //================================================================================================= 28 | 29 | #include 30 | 31 | int main(int argc, char **argv) { 32 | ros::init(argc, argv, "pose_estimation"); 33 | hector_pose_estimation::PoseEstimationNode node; 34 | if (!node.init()) return 1; 35 | 36 | ros::spin(); 37 | 38 | node.cleanup(); 39 | return 0; 40 | } 41 | -------------------------------------------------------------------------------- /resources/ROSResources/hector_localization/message_to_tf/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | Changelog for package message_to_tf 3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4 | 5 | 0.4.0 (2021-02-16) 6 | ------------------ 7 | * Update maintainer email address 8 | * Increase minimum CMake version to 3.0.2 to avoid the CMP0048 warning 9 | See 10 | http://wiki.ros.org/noetic/Migration#Increase_required_CMake_version_to_avoid_author_warning 11 | for details. 12 | * Contributors: Johannes Meyer 13 | 14 | 0.3.0 (2016-06-27) 15 | ------------------ 16 | 17 | 0.2.2 (2016-06-24) 18 | ------------------ 19 | 20 | 0.2.1 (2015-11-08) 21 | ------------------ 22 | * Update error message 23 | * Add TransformStamped as an input type 24 | * Contributors: Paul Bovbel 25 | 26 | 0.2.0 (2015-02-22) 27 | ------------------ 28 | 29 | 0.1.5 (2014-10-02) 30 | ------------------ 31 | * get subscribed topic from the command line 32 | * initialize origin when publishing imu transform and fixed imu pose output (fix #6) 33 | * Contributors: Johannes Meyer 34 | 35 | 0.1.4 (2014-08-28) 36 | ------------------ 37 | 38 | 0.1.3 (2014-07-09) 39 | ------------------ 40 | * message_to_tf: fixed base_link transform publishing (was removed in 77f2cc2334d15fc0e9395ceb9b40cd4601448289) 41 | * Contributors: Johannes Meyer 42 | 43 | 0.1.2 (2014-06-02) 44 | ------------------ 45 | * Add parameter for optionally not publishing roll/pitch to tf 46 | * Don´t publish roll/pitch (to be parametrized soon) 47 | * Contributors: Stefan Kohlbrecher, hector1 48 | 49 | 0.1.1 (2014-03-30) 50 | ------------------ 51 | * added missing dependency to roscpp 52 | * Contributors: Johannes Meyer 53 | 54 | 0.1.0 (2013-09-03) 55 | ------------------ 56 | * catkinized stack hector_localization 57 | * readded tf_prefix support (deprecated feature in ROS hydro beta) 58 | * added ShapeShifter subscriber which accepts multiple message types 59 | * added euler angle publisher (Vector3Stamped) 60 | -------------------------------------------------------------------------------- /resources/ROSResources/hector_localization/message_to_tf/package.xml: -------------------------------------------------------------------------------- 1 | 2 | message_to_tf 3 | 0.4.0 4 | 5 | message_to_tf translates pose information from different kind of common_msgs message types to tf. Currently the node supports nav_msgs/Odometry, geometry_msgs/PoseStamped and sensor_msgs/Imu messages as input. 6 | The resulting transform is divided into three subtransforms with intermediate frames for the footprint and the stabilized base frame (without roll and pitch). 7 | 8 | Johannes Meyer 9 | 10 | BSD 11 | 12 | http://ros.org/wiki/message_to_tf 13 | 14 | 15 | Johannes Meyer 16 | 17 | 18 | catkin 19 | 20 | 21 | roscpp 22 | tf 23 | nav_msgs 24 | geometry_msgs 25 | sensor_msgs 26 | topic_tools 27 | 28 | 29 | roscpp 30 | tf 31 | nav_msgs 32 | geometry_msgs 33 | sensor_msgs 34 | topic_tools 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /resources/ROSResources/hector_models/README.md: -------------------------------------------------------------------------------- 1 | # hector_models 2 | hector_models contains (urdf) models and xacro macros of sensors and robot components. 3 | -------------------------------------------------------------------------------- /resources/ROSResources/hector_models/hector_components_description/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.3) 2 | project(hector_components_description) 3 | 4 | find_package(catkin REQUIRED) 5 | 6 | catkin_package( 7 | DEPENDS 8 | CATKIN_DEPENDS 9 | INCLUDE_DIRS 10 | LIBRARIES 11 | ) 12 | 13 | ############# 14 | ## Install ## 15 | ############# 16 | 17 | # all install targets should use catkin DESTINATION variables 18 | # See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html 19 | 20 | install(DIRECTORY meshes urdf 21 | DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} 22 | ) 23 | 24 | -------------------------------------------------------------------------------- /resources/ROSResources/hector_models/hector_components_description/urdf/checkerboard.urdf.xacro: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /resources/ROSResources/hector_models/hector_components_description/urdf/spinning_hokuyo_utm30lx.urdf.xacro: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /resources/ROSResources/hector_models/hector_components_description/urdf/vision_box_dimensions_hector1.urdf.xacro: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /resources/ROSResources/hector_models/hector_components_description/urdf/vision_box_dimensions_hector2.urdf.xacro: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /resources/ROSResources/hector_models/hector_models.rosinstall: -------------------------------------------------------------------------------- 1 | - git: {local-name: src/hector_models, uri: 'https://github.com/tu-darmstadt-ros-pkg/hector_models.git', version: hydro-devel} 2 | -------------------------------------------------------------------------------- /resources/ROSResources/hector_sensors_gazebo/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | Changelog for package hector_sensors_gazebo 3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4 | 5 | 0.5.1 (2018-06-29) 6 | ------------------ 7 | 8 | 0.5.0 (2016-06-24) 9 | ------------------ 10 | 11 | 0.4.1 (2016-06-24) 12 | ------------------ 13 | 14 | 0.4.0 (2015-11-07) 15 | ------------------ 16 | 17 | 0.3.8 (2016-06-24) 18 | ------------------ 19 | 20 | 0.3.7 (2015-11-07) 21 | ------------------ 22 | 23 | 0.3.6 (2015-03-21) 24 | ------------------ 25 | 26 | 0.3.5 (2015-02-23) 27 | ------------------ 28 | 29 | 0.3.4 (2014-09-01) 30 | ------------------ 31 | 32 | 0.3.3 (2014-05-27) 33 | ------------------ 34 | 35 | 0.3.2 (2014-03-30) 36 | ------------------ 37 | * removed metapackage tag from hector_sensors_gazebo to not break packages depending on it 38 | * hector_gazebo: Made hector_gazebo and hector_sensors_gazebo true metapackages 39 | * Moved package from hector_models to hector_gazebo 40 | * Contributors: Johannes Meyer 41 | 42 | 0.3.0 (2013-09-02) 43 | ------------------ 44 | * catkinized stack hector_models 45 | -------------------------------------------------------------------------------- /resources/ROSResources/hector_sensors_gazebo/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.3) 2 | project(hector_sensors_gazebo) 3 | find_package(catkin REQUIRED) 4 | catkin_metapackage() 5 | -------------------------------------------------------------------------------- /resources/ROSResources/hector_sensors_gazebo/package.xml: -------------------------------------------------------------------------------- 1 | 2 | hector_sensors_gazebo 3 | 0.5.1 4 | hector_sensors_gazebo depends on the necessary plugins for using the sensors from the hector_models repository. 5 | Johannes Meyer 6 | 7 | BSD 8 | 9 | http://ros.org/wiki/hector_sensors_gazebo 10 | 11 | 12 | Stefan Kohlbrecher 13 | 14 | 15 | catkin 16 | 17 | 18 | hector_sensors_description 19 | gazebo_plugins 20 | hector_gazebo_plugins 21 | 22 | 23 | -------------------------------------------------------------------------------- /resources/ROSResources/image_channels.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import numpy as np 4 | import cv2 5 | 6 | 7 | image_name = "tree" 8 | 9 | print 'read an image from file' 10 | color_image = cv2.imread("images/tree.jpg",cv2.IMREAD_COLOR) 11 | 12 | print 'display image in native color' 13 | cv2.imshow("Original Image",color_image) 14 | cv2.moveWindow("Original Image",0,0) 15 | print(color_image.shape) 16 | height,width,channels = color_image.shape 17 | 18 | print 'slipt the image into three channels.' 19 | blue,green,red = cv2.split(color_image) 20 | 21 | cv2.imshow("Blue Channel",blue) 22 | cv2.moveWindow("Blue Channel",0,height) 23 | 24 | cv2.imshow("Red Channel",red) 25 | cv2.moveWindow("Red Channel",0,height) 26 | 27 | cv2.imshow("Greeen Channel",green) 28 | cv2.moveWindow("Green Channel",0,height) 29 | 30 | # Hue: indicates the type of color that we see in a 360 degree format. 31 | # Saturation: an indication of how saturated an individual color is 32 | # Value: indicates how luminous the channel is. 33 | 34 | print '---- slipt the image into Hue, Saturation, Value channels.----- ' 35 | hsv = cv2.cvtColor(color_image, cv2.COLOR_BGR2HSV) 36 | h,s,v = cv2.split(hsv) 37 | hsv_image = np.concatenate((h,s,v),axis=1) 38 | cv2.imshow("Hue, Saturation, Value Image",hsv_image) 39 | 40 | 41 | print '------ converts an image to a grayscale ------' 42 | gray_image = cv2.cvtColor(color_image, cv2.COLOR_BGR2GRAY) 43 | cv2.imshow("Gray Image ",gray_image) 44 | cv2.waitKey(0) 45 | cv2.destroyAllWindows() -------------------------------------------------------------------------------- /resources/ROSResources/image_draw.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import numpy as np 4 | import cv2 5 | 6 | 7 | image = np.zeros((512,512,3), np.uint8) 8 | 9 | #cv2.circle(image, (image.shape[0]/2, image.shape[1]/2),63, (255,255,255), 5) 10 | cv2.line(image,(0,0),(511,511),(255,255,255),5) 11 | 12 | cv2.rectangle(image,(384,0),(510,128),(0,255,0),3) 13 | cv2.ellipse(image,(256,256),(100,50),0,0,180,255,-1) 14 | 15 | pts = np.array([[10,5],[20,30],[70,20],[50,10]], np.int32) 16 | pts = pts.reshape((-1,1,2)) 17 | cv2.polylines(image,[pts],True,(0,255,255)) 18 | 19 | font = cv2.FONT_HERSHEY_SIMPLEX 20 | #cv2.putText(image,'ROS, OpenCV',(10,500), font, 2,(255,255,255),2,cv2.LINE_AA) 21 | cv2.putText(image,'OpenCV',(10,500), font, 4,(255,255,255),2) 22 | cv2.imshow("Image Panel",image) 23 | 24 | cv2.waitKey(0) 25 | cv2.destroyAllWindows() -------------------------------------------------------------------------------- /resources/ROSResources/image_encoding.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import numpy as np 4 | import cv2 5 | 6 | 7 | image_name = "tree" 8 | 9 | print ('read an image from file') 10 | color_image = cv2.imread("images/tree.jpg",cv2.IMREAD_COLOR) 11 | 12 | print ('display image in native color') 13 | cv2.imshow("Original Image",color_image) 14 | cv2.moveWindow("Original Image",0,0) 15 | print(color_image.shape) 16 | 17 | height,width,channels = color_image.shape 18 | 19 | print ('slipt the image into three channels.') 20 | blue,green,red = cv2.split(color_image) 21 | 22 | cv2.imshow("Blue Channel",blue) 23 | cv2.moveWindow("Blue Channel",0,height) 24 | 25 | cv2.imshow("Red Channel",red) 26 | cv2.moveWindow("Red Channel",0,height) 27 | 28 | cv2.imshow("Greeen Channel",green) 29 | cv2.moveWindow("Green Channel",0,height) 30 | 31 | 32 | # Hue: indicates the type of color that we see in a 360 degree format. 33 | # Saturation: an indication of how saturated an individual color is 34 | # Value: indicates how luminous the channel is. 35 | 36 | print ('---- slipt the image into Hue, Saturation, Value channels.----- ') 37 | hsv = cv2.cvtColor(color_image, cv2.COLOR_BGR2HSV) 38 | h,s,v = cv2.split(hsv) 39 | hsv_image = np.concatenate((h,s,v),axis=1) 40 | cv2.imshow("Hue, Saturation, Value Image",hsv_image) 41 | cv2.imshow("HSV Image",hsv) 42 | 43 | 44 | print ('------ converts an image to a grayscale ------') 45 | gray_image = cv2.cvtColor(color_image, cv2.COLOR_BGR2GRAY) 46 | cv2.imshow("Gray Image ",gray_image) 47 | 48 | print (gray_image) 49 | 50 | cv2.waitKey(0) 51 | cv2.destroyAllWindows() 52 | -------------------------------------------------------------------------------- /resources/ROSResources/image_pub_sub.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import rospy 4 | import cv2 5 | from std_msgs.msg import String 6 | from sensor_msgs.msg import Image 7 | from cv_bridge import CvBridge, CvBridgeError 8 | import sys 9 | 10 | bridge = CvBridge() 11 | 12 | def image_callback(ros_image): 13 | print 'got an image' 14 | global bridge 15 | #convert ros_image into an opencv-compatible image 16 | try: 17 | cv_image = bridge.imgmsg_to_cv2(ros_image, "bgr8") 18 | except CvBridgeError as e: 19 | print(e) 20 | #from now on, you can work exactly like with opencv 21 | (rows,cols,channels) = cv_image.shape 22 | if cols > 200 and rows > 200 : 23 | cv2.circle(cv_image, (100,100),90, 255) 24 | font = cv2.FONT_HERSHEY_SIMPLEX 25 | cv2.putText(cv_image,'Webcam Activated with ROS & OpenCV!',(10,350), font, 1,(255,255,255),2,cv2.LINE_AA) 26 | cv2.imshow("Image window", cv_image) 27 | cv2.waitKey(3) 28 | 29 | 30 | def main(args): 31 | rospy.init_node('image_converter', anonymous=True) 32 | #for turtlebot3 waffle 33 | #image_topic="/camera/rgb/image_raw/compressed" 34 | #for usb cam 35 | #image_topic="/usb_cam/image_raw" 36 | image_sub = rospy.Subscriber("/usb_cam/image_raw",Image, image_callback) 37 | try: 38 | rospy.spin() 39 | except KeyboardInterrupt: 40 | print("Shutting down") 41 | cv2.destroyAllWindows() 42 | 43 | if __name__ == '__main__': 44 | main(sys.argv) -------------------------------------------------------------------------------- /resources/ROSResources/image_pub_sub_class.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from __future__ import print_function 3 | 4 | import roslib 5 | #roslib.load_manifest('my_package') 6 | import sys 7 | import rospy 8 | import cv2 9 | from std_msgs.msg import String 10 | from sensor_msgs.msg import Image 11 | from cv_bridge import CvBridge, CvBridgeError 12 | 13 | class image_converter: 14 | 15 | def __init__(self): 16 | self.image_pub = rospy.Publisher("image_topic_2",Image) 17 | 18 | self.bridge = CvBridge() 19 | self.image_sub = rospy.Subscriber("image_topic",Image,self.callback) 20 | 21 | def callback(self,data): 22 | try: 23 | cv_image = self.bridge.imgmsg_to_cv2(data, "bgr8") 24 | except CvBridgeError as e: 25 | print(e) 26 | 27 | (rows,cols,channels) = cv_image.shape 28 | if cols > 60 and rows > 60 : 29 | cv2.circle(cv_image, (50,50), 10, 255) 30 | 31 | cv2.imshow("Image window", cv_image) 32 | cv2.waitKey(3) 33 | 34 | try: 35 | self.image_pub.publish(self.bridge.cv2_to_imgmsg(cv_image, "bgr8")) 36 | except CvBridgeError as e: 37 | print(e) 38 | 39 | def main(args): 40 | ic = image_converter() 41 | rospy.init_node('image_converter', anonymous=True) 42 | try: 43 | rospy.spin() 44 | except KeyboardInterrupt: 45 | print("Shutting down") 46 | cv2.destroyAllWindows() 47 | 48 | if __name__ == '__main__': 49 | main(sys.argv) -------------------------------------------------------------------------------- /resources/ROSResources/image_structure.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | #import numpy: the data structure that will handle an image 4 | import numpy as np 5 | 6 | #import openCV 7 | import cv2 8 | 9 | image_name = "blackwhite" 10 | 11 | print ('read an image from file') 12 | img = cv2.imread("images/"+image_name+".jpg") 13 | 14 | print ('display the content of the image') 15 | print (img) 16 | print ('In Python, an image is stored in a numpy array. Numpy is library used for scientific computing of multi-dimensional arrays and matrices.') 17 | 18 | print ('we can determine several features of the images using numpy array properties') 19 | print ('type of an image type(img): %s'%type(img)) 20 | print ('size of the image img.size: %d'%img.size) 21 | print ('length of the image (number of pixel in the vertical direction) len(img): %d'%len(img)) 22 | print ('shape of an image (length in pixe, width in pixel, number of color) img.shape (%d,%d,%d)'%img.shape) 23 | print ('image length (also height) img.shape[0]: %d'%img.shape[0]) 24 | print ('image width img.shape[1]: %d'%img.shape[1]) 25 | 26 | height, width, channels = img.shape 27 | print ('height = %d'%height) 28 | print ('width = %d'%width) 29 | print ('channels = %d'%channels) 30 | 31 | print ('number of colors per pixel img.shape[2]: %d'%img.shape[2]) 32 | print ('number of pixels: %d'%(img.shape[0]*img.shape[1])) 33 | print ('type of the image img.dtype: %s'%img.dtype) 34 | print ('sub-image at row [10] (img[10])') 35 | print (img[10]) 36 | print ('shape of sub-image at row [0] (img[10].shape)') 37 | print (img[10].shape) 38 | print ('pixel at raw 10 and column 5 (img[10, 5])') 39 | print (img[10, 5]) 40 | print (img[10] [5]) 41 | print ('pixel at raw 0 and column 0 (img[0, 0])') 42 | print (img[0, 0]) 43 | print (img[0] [0]) 44 | 45 | print ('you can see a single channel in the image, for example only the first channel') 46 | print (img[:, :, 0]) 47 | 48 | -------------------------------------------------------------------------------- /resources/ROSResources/image_thresholding.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import numpy as np 4 | import cv2 5 | 6 | 7 | def read_image(image_name, as_gray): 8 | if as_gray: 9 | image = cv2.imread(image_name,cv2.IMREAD_GRAYSCALE) 10 | else: 11 | image = cv2.imread(image_name,cv2.IMREAD_COLOR) 12 | cv2.imshow("Image",image) 13 | return image 14 | 15 | 16 | 17 | def basic_thresholding(gray_image, threshol_value): 18 | ret, thresh_basic = cv2.threshold(gray_image, 19 | threshol_value, 20 | 255, 21 | cv2.THRESH_BINARY_INV) 22 | cv2.imshow("Basic Binary Image",thresh_basic) 23 | 24 | def adaptive_thresholding(gray_image, threshol_value): 25 | adaptive_threshold_image = cv2.adaptiveThreshold(gray_image, 26 | 255, 27 | cv2.ADAPTIVE_THRESH_MEAN_C, 28 | cv2.THRESH_BINARY_INV, 29 | threshol_value, 30 | 2) 31 | cv2.imshow("Adaptive Threshold Image",adaptive_threshold_image) 32 | 33 | 34 | def main(): 35 | #image_name = "images/shapes.png" 36 | image_name = "images/tomato.jpg" 37 | as_gray = True 38 | threshol_value=115 39 | gray_image = read_image(image_name,as_gray) 40 | basic_thresholding(gray_image, threshol_value) 41 | #adaptive_thresholding(gray_image, threshol_value) 42 | cv2.waitKey(0) 43 | cv2.destroyAllWindows() 44 | 45 | if __name__ == '__main__': 46 | main() -------------------------------------------------------------------------------- /resources/ROSResources/iot_sensor_publisher.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # license removed for brevity 3 | import rospy 4 | from ros_essentials_cpp.msg import IoTSensor 5 | import random 6 | 7 | #create a new publisher. we specify the topic name, then type of message then the queue size 8 | pub = rospy.Publisher('iot_sensor_topic', IoTSensor, queue_size=10) 9 | 10 | #we need to initialize the node 11 | rospy.init_node('iot_sensor_publisher_node', anonymous=True) 12 | 13 | #set the loop rate 14 | rate = rospy.Rate(1) # 1hz 15 | #keep publishing until a Ctrl-C is pressed 16 | i = 0 17 | while not rospy.is_shutdown(): 18 | iot_sensor = IoTSensor() 19 | iot_sensor.id = 1 20 | iot_sensor.name="iot_parking_01" 21 | iot_sensor.temperature = 24.33 + (random.random()*2) 22 | iot_sensor.humidity = 33.41+ (random.random()*2) 23 | rospy.loginfo("I publish:") 24 | rospy.loginfo(iot_sensor) 25 | pub.publish(iot_sensor) 26 | rate.sleep() 27 | i=i+1 28 | 29 | -------------------------------------------------------------------------------- /resources/ROSResources/iot_sensor_subscriber.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import rospy 3 | from ros_essentials_cpp.msg import IoTSensor 4 | 5 | def iot_sensor_callback(iot_sensor_message): 6 | rospy.loginfo("new IoT data received: (%d, %s, %.2f ,%.2f)", 7 | iot_sensor_message.id,iot_sensor_message.name, 8 | iot_sensor_message.temperature,iot_sensor_message.humidity) 9 | 10 | rospy.init_node('iot_sensor_subscriber_node', anonymous=True) 11 | 12 | rospy.Subscriber("iot_sensor_topic", IoTSensor, iot_sensor_callback) 13 | 14 | # spin() simply keeps python from exiting until this node is stopped 15 | rospy.spin() 16 | -------------------------------------------------------------------------------- /resources/ROSResources/open_copy.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | #import numpy: the data structure that will handle an image 4 | import numpy as np 5 | 6 | #import openCV 7 | import cv2 8 | 9 | 10 | image_name = "flower" 11 | 12 | print ('read an image from file') 13 | img = cv2.imread("images/"+image_name+".jpg") 14 | 15 | print ('create a window holder for the image') 16 | cv2.namedWindow("Image",cv2.WINDOW_NORMAL) 17 | 18 | print ('display the image') 19 | cv2.imshow("Image",img) 20 | 21 | print ('press a key inside the image to make a copy') 22 | cv2.waitKey(0) 23 | 24 | print ('image copied to folder images/copy/') 25 | cv2.imwrite("images/copy/"+image_name+"-copy.jpg",img) 26 | -------------------------------------------------------------------------------- /resources/ROSResources/read_video.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import cv2 4 | 5 | #video_capture = cv2.VideoCapture(0) 6 | video_capture = cv2.VideoCapture('video/ros.mp4') 7 | 8 | while(True): 9 | ret, frame = video_capture.read() 10 | 11 | frame = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) 12 | frame = cv2.resize(frame, (0,0), fx=0.5,fy=0.5) 13 | #cv2.line(frame,(0,0),(511,511),(255,0,0),5) 14 | cv2.imshow("Frame",frame) 15 | if cv2.waitKey(1) & 0xFF == ord('q'): 16 | break 17 | 18 | video_capture.release() 19 | cv2.destroyAllWindows() -------------------------------------------------------------------------------- /resources/ROSResources/scan_subscriber.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import rospy 3 | from sensor_msgs.msg import LaserScan 4 | import math 5 | 6 | def scan_callback(scan_data): 7 | #Find minimum range 8 | min_value, min_index = min_range_index(scan_data.ranges) 9 | print "\nthe minimum range value is: ", min_value 10 | print "the minimum range index is: ", min_index 11 | 12 | max_value, max_index = max_range_index(scan_data.ranges) 13 | print "\nthe maximum range value is: ", max_value 14 | print "the maximum range index is: ", max_index 15 | 16 | average_value = average_range (scan_data.ranges) 17 | print "\nthe average range value is: ", average_value 18 | 19 | average2 = average_between_indices(scan_data.ranges, 2, 7) 20 | print "\nthe average between 2 indices is: ", average2 21 | 22 | print "the field of view: ", field_of_view(scan_data) 23 | 24 | def field_of_view(scan_data): 25 | return (scan_data.angle_max-scan_data.angle_min)*180.0/3.14 26 | 27 | #find the max range and its index 28 | def min_range_index(ranges): 29 | ranges = [x for x in ranges if not math.isnan(x)] 30 | return (min(ranges), ranges.index(min(ranges)) ) 31 | 32 | #find the max range 33 | def max_range_index(ranges): 34 | ranges = [x for x in ranges if not math.isnan(x)] 35 | return (max(ranges), ranges.index(max(ranges)) ) 36 | 37 | #find the average range 38 | def average_range(ranges): 39 | ranges = [x for x in ranges if not math.isnan(x)] 40 | return ( sum(ranges) / float(len(ranges)) ) 41 | 42 | def average_between_indices(ranges, i, j): 43 | ranges = [x for x in ranges if not math.isnan(x)] 44 | slice_of_array = ranges[i: j+1] 45 | return ( sum(slice_of_array) / float(len(slice_of_array)) ) 46 | 47 | 48 | if __name__ == '__main__': 49 | 50 | #init new a node and give it a name 51 | rospy.init_node('scan_node', anonymous=True) 52 | #subscribe to the topic /scan. 53 | rospy.Subscriber("scan", LaserScan, scan_callback) 54 | 55 | # spin() simply keeps python from exiting until this node is stopped 56 | rospy.spin() -------------------------------------------------------------------------------- /resources/ROSResources/tf_scan.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /resources/graphics/JBOP.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sr42-dev/scaling-spoon/59e86c5f2aba61d4d87731aba5b6b042f7985120/resources/graphics/JBOP.png -------------------------------------------------------------------------------- /resources/graphics/adithyaOP.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sr42-dev/scaling-spoon/59e86c5f2aba61d4d87731aba5b6b042f7985120/resources/graphics/adithyaOP.png -------------------------------------------------------------------------------- /resources/graphics/adithyaOP2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sr42-dev/scaling-spoon/59e86c5f2aba61d4d87731aba5b6b042f7985120/resources/graphics/adithyaOP2.png -------------------------------------------------------------------------------- /resources/graphics/archanaaOP.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sr42-dev/scaling-spoon/59e86c5f2aba61d4d87731aba5b6b042f7985120/resources/graphics/archanaaOP.png -------------------------------------------------------------------------------- /resources/graphics/bellCurve.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sr42-dev/scaling-spoon/59e86c5f2aba61d4d87731aba5b6b042f7985120/resources/graphics/bellCurve.jpg -------------------------------------------------------------------------------- /resources/graphics/courseCover.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sr42-dev/scaling-spoon/59e86c5f2aba61d4d87731aba5b6b042f7985120/resources/graphics/courseCover.jpeg -------------------------------------------------------------------------------- /resources/graphics/varchasvinOP.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sr42-dev/scaling-spoon/59e86c5f2aba61d4d87731aba5b6b042f7985120/resources/graphics/varchasvinOP.png --------------------------------------------------------------------------------