├── people_msgs
├── msg
│ ├── People.msg
│ ├── PersonStamped.msg
│ ├── Person.msg
│ ├── PositionMeasurementArray.msg
│ └── PositionMeasurement.msg
├── CMakeLists.txt
├── package.xml
└── CHANGELOG.rst
├── face_detector
├── param
│ └── classifier.yaml
├── action
│ └── FaceDetector.action
├── test
│ ├── wide-stereo_true_rtest.xml
│ ├── action-rgbd_true_rtest.xml
│ ├── narrow-stereo_true_rtest.xml
│ ├── wide-stereo_false_rtest.xml
│ ├── action-rgbd_false_rtest.xml
│ ├── action-wide_false_rtest.xml
│ ├── action-wide_true_rtest.xml
│ ├── narrow-stereo_false_rtest.xml
│ ├── rgbd_false_rtest.xml
│ ├── rgbd_true_rtest.xml
│ └── common_rtest.xml
├── launch
│ ├── face_detector.narrow.launch
│ ├── face_detector_action.rgbd.launch
│ ├── face_detector_action.wide.launch
│ ├── face_detector.wide.launch
│ ├── face_detector.rgbd.launch
│ └── face_detector_common.launch
├── scripts
│ └── face_detector_action_client.py
├── package.xml
├── CHANGELOG.rst
├── mainpage.dox
├── CMakeLists.txt
└── include
│ └── face_detector
│ └── faces.h
├── people
├── CMakeLists.txt
├── CHANGELOG.rst
└── package.xml
├── leg_detector
├── launch
│ ├── leg_detector.launch
│ ├── filtered_leg_detector.launch
│ └── shadows.launch
├── package.xml
├── cfg
│ └── LegDetector.cfg
├── CMakeLists.txt
├── include
│ └── leg_detector
│ │ ├── calc_leg_features.h
│ │ └── laser_processor.h
├── CHANGELOG.rst
└── src
│ ├── laser_processor.cpp
│ ├── train_leg_detector.cpp
│ └── calc_leg_features.cpp
├── people_velocity_tracker
├── launch
│ ├── tracked_detector.launch
│ └── filtered_tracked_detector.launch
├── package.xml
├── CHANGELOG.rst
├── CMakeLists.txt
└── scripts
│ ├── static.py
│ └── tracker.py
├── people_tracking_filter
├── package.xml
├── launch
│ └── filter.launch
├── CHANGELOG.rst
├── CMakeLists.txt
├── include
│ └── people_tracking_filter
│ │ ├── mcpdf_vector.h
│ │ ├── state_pos_vel.h
│ │ ├── uniform_vector.h
│ │ ├── gaussian_vector.h
│ │ ├── mcpdf_pos_vel.h
│ │ ├── gaussian_pos_vel.h
│ │ ├── measmodel_vector.h
│ │ ├── measmodel_pos.h
│ │ ├── sysmodel_vector.h
│ │ ├── tracker.h
│ │ ├── sysmodel_pos_vel.h
│ │ ├── people_tracking_node.h
│ │ ├── detector_particle.h
│ │ ├── tracker_kalman.h
│ │ └── tracker_particle.h
└── src
│ ├── measmodel_pos.cpp
│ ├── sysmodel_vector.cpp
│ ├── measmodel_vector.cpp
│ ├── sysmodel_pos_vel.cpp
│ ├── uniform_vector.cpp
│ ├── gaussian_pos_vel.cpp
│ ├── gaussian_vector.cpp
│ ├── detector_particle.cpp
│ ├── tracker_particle.cpp
│ ├── mcpdf_vector.cpp
│ ├── mcpdf_pos_vel.cpp
│ └── tracker_kalman.cpp
└── README.md
/people_msgs/msg/People.msg:
--------------------------------------------------------------------------------
1 | std_msgs/Header header
2 | people_msgs/Person[] people
3 |
--------------------------------------------------------------------------------
/people_msgs/msg/PersonStamped.msg:
--------------------------------------------------------------------------------
1 | std_msgs/Header header
2 | people_msgs/Person person
3 |
4 |
--------------------------------------------------------------------------------
/face_detector/param/classifier.yaml:
--------------------------------------------------------------------------------
1 | classifier_filename: //usr/share/opencv/haarcascades/haarcascade_frontalface_alt.xml
2 |
--------------------------------------------------------------------------------
/people/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 2.8.3)
2 | project(people)
3 | find_package(catkin REQUIRED)
4 | catkin_metapackage()
5 |
--------------------------------------------------------------------------------
/face_detector/action/FaceDetector.action:
--------------------------------------------------------------------------------
1 | #goal
2 | ---
3 | #result
4 | people_msgs/PositionMeasurement[] face_positions
5 | ---
6 | #feedback
7 |
--------------------------------------------------------------------------------
/people_msgs/msg/Person.msg:
--------------------------------------------------------------------------------
1 | string name
2 | geometry_msgs/Point position
3 | geometry_msgs/Point velocity
4 | float64 reliability
5 | string[] tagnames
6 | string[] tags
7 |
8 |
--------------------------------------------------------------------------------
/people_msgs/msg/PositionMeasurementArray.msg:
--------------------------------------------------------------------------------
1 | std_msgs/Header header
2 |
3 | # All of the people found
4 | people_msgs/PositionMeasurement[] people
5 |
6 | # The co-occurrence matrix between people
7 | float32[] cooccurrence
8 |
9 |
--------------------------------------------------------------------------------
/leg_detector/launch/leg_detector.launch:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
--------------------------------------------------------------------------------
/leg_detector/launch/filtered_leg_detector.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
--------------------------------------------------------------------------------
/people_msgs/msg/PositionMeasurement.msg:
--------------------------------------------------------------------------------
1 | std_msgs/Header header
2 | # The name of the detector that detected the person (i.e frontalface, profileface)
3 | string name
4 | string object_id
5 | geometry_msgs/Point pos
6 | float64 reliability
7 | float64[9] covariance
8 | byte initialization
9 |
10 |
--------------------------------------------------------------------------------
/people_velocity_tracker/launch/tracked_detector.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/people_velocity_tracker/launch/filtered_tracked_detector.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/face_detector/test/wide-stereo_true_rtest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/face_detector/test/action-rgbd_true_rtest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/face_detector/test/narrow-stereo_true_rtest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/leg_detector/launch/shadows.launch:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
9 |
10 |
--------------------------------------------------------------------------------
/face_detector/test/wide-stereo_false_rtest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/face_detector/test/action-rgbd_false_rtest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/face_detector/test/action-wide_false_rtest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/face_detector/test/action-wide_true_rtest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/face_detector/test/narrow-stereo_false_rtest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/people/CHANGELOG.rst:
--------------------------------------------------------------------------------
1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 | Changelog for package people
3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4 |
5 | 1.0.9 (2015-09-01)
6 | ------------------
7 |
8 | 1.0.8 (2014-12-10)
9 | ------------------
10 | * moved social_navigation_layers from metapackage
11 | * Contributors: Dan Lazewatsky
12 |
13 | 1.0.3 (2014-03-01)
14 | ------------------
15 |
16 | 1.0.2 (2014-02-28)
17 | ------------------
18 |
19 | 1.0.1 (2014-02-27)
20 | ------------------
21 | * catkinizing
22 | * Contributors: Dan Lazewatsky
23 |
--------------------------------------------------------------------------------
/face_detector/launch/face_detector.narrow.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/people_msgs/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 2.8.3)
2 | project(people_msgs)
3 | find_package(catkin REQUIRED COMPONENTS geometry_msgs message_generation std_msgs)
4 |
5 | add_message_files(
6 | DIRECTORY msg
7 | FILES
8 | People.msg
9 | Person.msg
10 | PersonStamped.msg
11 | PositionMeasurement.msg
12 | PositionMeasurementArray.msg
13 | )
14 |
15 | generate_messages(
16 | DEPENDENCIES geometry_msgs std_msgs
17 | )
18 |
19 | catkin_package(
20 | CATKIN_DEPENDS geometry_msgs message_runtime std_msgs
21 | )
22 |
--------------------------------------------------------------------------------
/people_msgs/package.xml:
--------------------------------------------------------------------------------
1 |
2 | people_msgs
3 | 1.4.0
4 | Messages used by nodes in the people stack.
5 | Dan Lazewatsky
6 | David V. Lu!!
7 |
8 | BSD
9 |
10 | http://ros.org/wiki/people_msgs
11 | Caroline Pantofaru
12 | catkin
13 | geometry_msgs
14 | std_msgs
15 | message_generation
16 | message_runtime
17 | message_runtime
18 |
19 |
--------------------------------------------------------------------------------
/face_detector/test/rgbd_false_rtest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/face_detector/launch/face_detector_action.rgbd.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/people_msgs/CHANGELOG.rst:
--------------------------------------------------------------------------------
1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 | Changelog for package people_msgs
3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4 |
5 | 1.2.0 (2019-08-19)
6 | ------------------
7 | * Document name field in PositionMeasurement (`#75 `_)
8 | * Cleanup (`#73 `_)
9 | * Fill in implied packages
10 | * Misc Whitespace cleanup
11 | * Contributors: David V. Lu!!, Shane Loretz
12 |
13 | 1.0.9 (2015-09-01)
14 | ------------------
15 |
16 | 1.0.8 (2014-12-10)
17 | ------------------
18 |
19 | 1.0.3 (2014-03-01)
20 | ------------------
21 |
22 | 1.0.2 (2014-02-28)
23 | ------------------
24 |
25 | 1.0.1 (2014-02-27)
26 | ------------------
27 | * catkinizing
28 | * Contributors: Dan Lazewatsky
29 |
--------------------------------------------------------------------------------
/face_detector/test/rgbd_true_rtest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/face_detector/launch/face_detector_action.wide.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/people_tracking_filter/package.xml:
--------------------------------------------------------------------------------
1 |
2 | people_tracking_filter
3 | 1.4.0
4 |
5 | A collection of filtering tools for tracking people's locations
6 |
7 | Caroline Pantofaru
8 | David V. Lu!!
9 | BSD
10 | http://ros.org/wiki/people_tracking_filter
11 |
12 | catkin
13 |
14 | bfl
15 | geometry_msgs
16 | message_filters
17 | people_msgs
18 | roscpp
19 | sensor_msgs
20 | std_msgs
21 | tf
22 | roslaunch
23 | roslint
24 |
25 |
--------------------------------------------------------------------------------
/people_velocity_tracker/package.xml:
--------------------------------------------------------------------------------
1 |
2 | people_velocity_tracker
3 | 1.4.0
4 | Track the output of the leg_detector to indicate the velocity of person.
5 | David V. Lu!!
6 | David V. Lu!!
7 | BSD
8 | http://ros.org/wiki/people_velocity_tracker
9 |
10 | catkin
11 | easy_markers
12 | geometry_msgs
13 | kalman_filter
14 | people_msgs
15 | roslib
16 | rospy
17 | leg_detector
18 | roslaunch
19 | roslint
20 |
21 |
--------------------------------------------------------------------------------
/people/package.xml:
--------------------------------------------------------------------------------
1 |
2 | people
3 | 1.4.0
4 | The people stack holds algorithms for perceiving people from a number of sensors.
5 | Dan Lazewatsky
6 | David V. Lu!!
7 |
8 | BSD
9 |
10 | http://ros.org/wiki/people
11 | Caroline Pantofaru
12 | catkin
13 | face_detector
14 | leg_detector
15 | people_msgs
16 | people_tracking_filter
17 | people_velocity_tracker
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/people_velocity_tracker/CHANGELOG.rst:
--------------------------------------------------------------------------------
1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 | Changelog for package people_velocity_tracker
3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4 |
5 | 1.2.0 (2019-08-19)
6 | ------------------
7 | * Whitespace cleanup (`#73 `_)
8 | * Contributors: David V. Lu!!
9 |
10 | 1.0.9 (2015-09-01)
11 | ------------------
12 | * change queue sizes to 10
13 | * Update for Indigo and add unfiltered people velocity launcher
14 | * PEP8 fixes
15 | * Contributors: Aaron Blasdel
16 |
17 | 1.0.8 (2014-12-10)
18 | ------------------
19 |
20 | 1.0.4 (2014-07-09)
21 | ------------------
22 | * Merging people_velocity_tracker into people
23 | * Contributors: David Lu!!
24 |
25 | 1.0.3 (2014-03-01)
26 | ------------------
27 |
28 | 1.0.2 (2014-02-28)
29 | ------------------
30 |
31 | 1.0.1 (2014-02-27)
32 | ------------------
33 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | People
2 | ======
3 | Algorithms related to detecting and tracking people using various robot sensors.
4 |
5 | ## Documentation
6 | [http://ros.org/wiki/people](http://ros.org/wiki/people)
7 |
8 | ## Status
9 | | Distro | Status |
10 | | ------ | ------ |
11 | | **Kinetic** | [](http://build.ros.org/job/Kbin_uX64__people__ubuntu_xenial_amd64__binary/) |
12 | | **Melodic** | [](http://build.ros.org/job/Mbin_uB64__people__ubuntu_bionic_amd64__binary/) |
13 | | **Dashing** | None |
14 |
15 | ## Current Branches
16 | * `kinetic` is used by the ROS `kinetic` distro.
17 |
18 | * `melodic` is used by the ROS `melodic` distro.
19 |
20 | * `ros2` is used by the ROS2 `dashing` distro.
21 |
--------------------------------------------------------------------------------
/people_velocity_tracker/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 2.8.3)
2 | project(people_velocity_tracker)
3 |
4 | find_package(catkin REQUIRED COMPONENTS
5 | easy_markers
6 | geometry_msgs
7 | kalman_filter
8 | people_msgs
9 | roslib
10 | rospy
11 | )
12 |
13 | catkin_package(
14 | CATKIN_DEPENDS
15 | easy_markers geometry_msgs kalman_filter people_msgs roslib rospy
16 | )
17 |
18 | if(CATKIN_ENABLE_TESTING)
19 | find_package(catkin REQUIRED COMPONENTS roslaunch roslint)
20 | roslaunch_add_file_check(launch)
21 | roslint_python()
22 | roslint_add_test()
23 | endif()
24 |
25 | install(FILES launch/filtered_tracked_detector.launch launch/tracked_detector.launch
26 | DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch
27 | )
28 |
29 | catkin_install_python(PROGRAMS scripts/static.py scripts/tracker.py
30 | DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
31 | )
32 |
--------------------------------------------------------------------------------
/face_detector/launch/face_detector.wide.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 |
--------------------------------------------------------------------------------
/leg_detector/package.xml:
--------------------------------------------------------------------------------
1 |
2 | leg_detector
3 | 1.4.0
4 | Leg Detector using a machine learning approach to find leg-like patterns of laser scanner readings.
5 | Caroline Pantofaru
6 | David V. Lu!!
7 | BSD
8 | http://ros.org/wiki/leg_detector
9 |
10 | catkin
11 | bfl
12 | dynamic_reconfigure
13 | geometry_msgs
14 | image_geometry
15 | laser_geometry
16 | message_filters
17 | people_msgs
18 | people_tracking_filter
19 | roscpp
20 | sensor_msgs
21 | std_msgs
22 | std_srvs
23 | tf
24 | visualization_msgs
25 | laser_filters
26 | map_laser
27 | roslaunch
28 | roslint
29 |
30 |
31 |
--------------------------------------------------------------------------------
/people_tracking_filter/launch/filter.launch:
--------------------------------------------------------------------------------
1 | \n\n
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/face_detector/scripts/face_detector_action_client.py:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env python
2 |
3 | import actionlib
4 |
5 | from face_detector.msg import FaceDetectorAction, FaceDetectorGoal
6 |
7 | import rospy
8 |
9 |
10 | def face_detector_client():
11 | # Creates the SimpleActionClient, passing the type of the action to the constructor.
12 | client = actionlib.SimpleActionClient('face_detector_action', FaceDetectorAction)
13 |
14 | # Waits until the action server has started up and started
15 | # listening for goals.
16 | client.wait_for_server()
17 |
18 | # Creates a goal to send to the action server. (no parameters)
19 | goal = FaceDetectorGoal()
20 |
21 | # Sends the goal to the action server.
22 | client.send_goal(goal)
23 |
24 | # Waits for the server to finish performing the action.
25 | client.wait_for_result()
26 |
27 | return client.get_result() # people_msgs/PositionMeasurement[] face_positions
28 |
29 |
30 | if __name__ == '__main__':
31 | try:
32 | # Initializes a rospy node so that the SimpleActionClient can
33 | # publish and subscribe over ROS.
34 | rospy.init_node('face_detector_action_client')
35 | result = face_detector_client()
36 | print('Done action')
37 | except rospy.ROSInterruptException:
38 | print('Program interrupted before completion')
39 |
--------------------------------------------------------------------------------
/face_detector/package.xml:
--------------------------------------------------------------------------------
1 |
2 | face_detector
3 | 1.4.0
4 | Face detection in images.
5 | Dan Lazewatsky
6 |
7 | BSD
8 |
9 | http://ros.org/wiki/face_detector
10 | Caroline Pantofaru
11 |
12 | catkin
13 |
14 | actionlib
15 | actionlib_msgs
16 | cv_bridge
17 | geometry_msgs
18 | image_geometry
19 | image_transport
20 | message_filters
21 | people_msgs
22 | rosbag
23 | roscpp
24 | roslib
25 | rospy
26 | sensor_msgs
27 | std_msgs
28 | std_srvs
29 | stereo_image_proc
30 | stereo_msgs
31 | tf
32 |
33 | message_generation
34 | message_runtime
35 |
36 | dynamic_reconfigure
37 | message_runtime
38 |
39 | roslaunch
40 | roslint
41 | rostest
42 | stereo_image_proc
43 |
44 |
--------------------------------------------------------------------------------
/face_detector/CHANGELOG.rst:
--------------------------------------------------------------------------------
1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 | Changelog for package face_detector
3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4 |
5 | 1.2.0 (2019-08-19)
6 | ------------------
7 | * Whitespace cleanu (`#73 `_)
8 | * Remove and move unused includes (`#70 `_)
9 | * Contributors: David V. Lu!!, Shane Loretz
10 |
11 | 1.0.9 (2015-09-01)
12 | ------------------
13 | * Install missing param directory: face_detector.rgbd.launch fails due to the `param` folder.
14 | * Contributors: Isaac I.Y. Saito
15 |
16 | 1.0.8 (2014-12-10)
17 | ------------------
18 | * cleanup formatting with astyle (supersedes `#18 `_)
19 | * centrally reference cascade from standalone opencv (addresses `#15 `_)
20 | * Contributors: Dan Lazewatsky
21 |
22 | 1.0.3 (2014-03-01)
23 | ------------------
24 | * fix message generation
25 | * Contributors: Dan Lazewatsky
26 |
27 | 1.0.2 (2014-02-28)
28 | ------------------
29 | * update to properly generate messages
30 | * Contributors: Dan Lazewatsky
31 |
32 | 1.0.1 (2014-02-27)
33 | ------------------
34 | * update some remappings to deal with the changed openni message api
35 | * convert 16FC1 depth images to 32FC1 and scale to get meters
36 | * switch constants to defines to get rid of linker issues for catkin switch
37 | * catkinizing
38 | * Contributors: Dan Lazewatsky
39 |
--------------------------------------------------------------------------------
/leg_detector/cfg/LegDetector.cfg:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | from dynamic_reconfigure.parameter_generator_catkin import ParameterGenerator, bool_t, double_t, int_t, str_t
4 |
5 | gen = ParameterGenerator()
6 |
7 | gen.add('connection_threshold', double_t, 0, '[m]', 0.06, 0, .25)
8 | gen.add('min_points_per_group', int_t, 0, '', 5, 1, 20)
9 |
10 |
11 | gen.add('leg_reliability_limit', double_t, 0, '', 0.7, 0, 1)
12 | gen.add('publish_legs', bool_t, 0, '', True)
13 | gen.add('publish_people', bool_t, 0, '', True)
14 | gen.add('publish_leg_markers', bool_t, 0, '', True)
15 | gen.add('publish_people_markers', bool_t, 0, '', True)
16 |
17 | gen.add('no_observation_timeout', double_t, 0, 'Timeout tolerance for no observations [s]', 0.5, 0, 5)
18 | gen.add('max_second_leg_age', double_t, 0, '[s]', 2.0, 0, 5)
19 | gen.add('max_track_jump', double_t, 0, '[m]', 1.0, 0, 5)
20 | gen.add('max_meas_jump', double_t, 0, '[m]', 0.75, 0, 5)
21 | gen.add('leg_pair_separation', double_t, 0, '[m]', 1.0, 0, 2)
22 | gen.add('fixed_frame', str_t, 0, 'Fixed Frame', 'odom_combined')
23 |
24 | gen.add('kalman_p', double_t, 0, '', 4, 0, 10)
25 | gen.add('kalman_q', double_t, 0, '', .002, 0, 10)
26 | gen.add('kalman_r', double_t, 0, '', 10, 0, 20)
27 | gen.add('kalman_on', int_t, 0, '', 1, 0, 1)
28 |
29 | exit(gen.generate('leg_detector', 'leg_detector', 'LegDetector'))
30 |
--------------------------------------------------------------------------------
/people_velocity_tracker/scripts/static.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python
2 |
3 | import argparse
4 |
5 | from people_msgs.msg import People, Person
6 |
7 | import rospy
8 |
9 |
10 | class VelocityTracker(object):
11 | def __init__(self, x, y, vx, vy):
12 | self.ppub = rospy.Publisher('/people', People, queue_size=10)
13 | self.person = Person()
14 | self.person.position.x = x
15 | self.person.position.y = y
16 | self.person.position.z = 0.5
17 | self.person.velocity.x = vx
18 | self.person.velocity.y = vy
19 | self.person.name = 'static_test_person'
20 | self.person.reliability = 0.90
21 |
22 | def spin(self):
23 | rate = rospy.Rate(10)
24 | while not rospy.is_shutdown():
25 | pl = People()
26 | pl.header.stamp = rospy.Time.now()
27 | pl.header.frame_id = '/base_link'
28 | pl.people.append(self.person)
29 | self.ppub.publish(pl)
30 | rate.sleep()
31 |
32 |
33 | if __name__ == '__main__':
34 | rospy.init_node('people_velocity_tracker')
35 | parser = argparse.ArgumentParser()
36 | parser.add_argument('x', type=float, help='x coordinate')
37 | parser.add_argument('y', type=float, help='y coordinate')
38 | parser.add_argument('vx', type=float, nargs='?', default=0.0, help='x velocity')
39 | parser.add_argument('vy', type=float, nargs='?', default=0.0, help='y velocity')
40 | args = parser.parse_args()
41 |
42 | vt = VelocityTracker(args.x, args.y, args.vx, args.vy)
43 | vt.spin()
44 |
--------------------------------------------------------------------------------
/face_detector/test/common_rtest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
26 |
27 | topics:
28 | - name: $(arg topicname_hztest)
29 | timeout: 5
30 | negative: False
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/face_detector/launch/face_detector.rgbd.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
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 |
--------------------------------------------------------------------------------
/face_detector/launch/face_detector_common.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 |
--------------------------------------------------------------------------------
/people_tracking_filter/CHANGELOG.rst:
--------------------------------------------------------------------------------
1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 | Changelog for package people_tracking_filter
3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4 |
5 | 1.2.0 (2019-08-19)
6 | ------------------
7 | * Fix bfl include directory (`#76 `_)
8 | * Whitespace cleanup (`#73 `_)
9 | * Contributors: David V. Lu!!, Lucas Chiesa
10 |
11 | 1.0.9 (2015-09-01)
12 | ------------------
13 | * Update CMakeLists.txt
14 | * Contributors: David Lu!!
15 |
16 | 1.0.8 (2014-12-10)
17 | ------------------
18 | * cleanup formatting with astyle (supersedes `#18 `_)
19 | * Contributors: Dan Lazewatsky
20 |
21 | 1.0.4 (2014-07-09)
22 | ------------------
23 | * merging people_tracking_filter into people
24 | * Contributors: David Lu!!
25 |
26 | 1.0.3 (2014-03-01)
27 | ------------------
28 |
29 | 1.0.2 (2014-02-28)
30 | ------------------
31 |
32 | 1.0.1 (2014-02-27)
33 | ------------------
34 | * people_tracking_filter --> people_experimental
35 | git-svn-id: https://code.ros.org/svn/wg-ros-pkg/trunk/stacks/people@40197 7275ad9f-c29b-430a-bdc5-66f4b3af1622
36 | * Added platform tags for Ubuntu 9.04, 9.10, and 10.04.
37 | git-svn-id: https://code.ros.org/svn/wg-ros-pkg/trunk/stacks/people@36945 7275ad9f-c29b-430a-bdc5-66f4b3af1622
38 | * Unblacklisting
39 | git-svn-id: https://code.ros.org/svn/wg-ros-pkg/trunk/stacks/people@33042 7275ad9f-c29b-430a-bdc5-66f4b3af1622
40 | * temporarily removed dep on message_sequencing
41 | git-svn-id: https://code.ros.org/svn/wg-ros-pkg/trunk/stacks/people@33041 7275ad9f-c29b-430a-bdc5-66f4b3af1622
42 | * more dependencies removed
43 | git-svn-id: https://code.ros.org/svn/wg-ros-pkg/trunk/stacks/people@32912 7275ad9f-c29b-430a-bdc5-66f4b3af1622
44 | * git-svn-id: https://code.ros.org/svn/wg-ros-pkg/trunk/stacks/people@32909 7275ad9f-c29b-430a-bdc5-66f4b3af1622
45 | * filter-->people_tracking_filter, follower-->person_follower
46 | git-svn-id: https://code.ros.org/svn/wg-ros-pkg/trunk/stacks/people@32896 7275ad9f-c29b-430a-bdc5-66f4b3af1622
47 | * Contributors: Brian Gerkey, Caroline Pantofaru
48 |
--------------------------------------------------------------------------------
/leg_detector/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 2.8.3)
2 | project(leg_detector)
3 |
4 | # look for bfl (Bayesian Filtering Library)
5 | find_package(PkgConfig REQUIRED)
6 | pkg_check_modules(BFL REQUIRED orocos-bfl)
7 | link_directories(${BFL_LIBRARY_DIRS})
8 |
9 | # Look for Bullet
10 | pkg_check_modules(BULLET bullet)
11 |
12 | find_package(catkin REQUIRED COMPONENTS
13 | dynamic_reconfigure
14 | geometry_msgs
15 | image_geometry
16 | laser_geometry
17 | message_filters
18 | people_msgs
19 | people_tracking_filter
20 | roscpp
21 | sensor_msgs
22 | std_msgs
23 | std_srvs
24 | tf
25 | visualization_msgs
26 | )
27 |
28 | ## dynamic reconfigure config
29 | generate_dynamic_reconfigure_options(
30 | cfg/LegDetector.cfg
31 | )
32 |
33 | catkin_package(
34 | INCLUDE_DIRS include
35 | CATKIN_DEPENDS
36 | dynamic_reconfigure
37 | geometry_msgs
38 | message_filters
39 | people_msgs
40 | people_tracking_filter
41 | roscpp
42 | sensor_msgs
43 | std_msgs
44 | tf
45 | visualization_msgs
46 | )
47 |
48 | include_directories(
49 | include ${catkin_INCLUDE_DIRS} ${BFL_INCLUDE_DIRS} ${BULLET_INCLUDE_DIRS}
50 | )
51 |
52 | add_executable(leg_detector
53 | src/laser_processor.cpp
54 | src/leg_detector.cpp
55 | src/calc_leg_features.cpp)
56 |
57 | add_dependencies(leg_detector ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
58 |
59 | target_link_libraries(leg_detector
60 | ${catkin_LIBRARIES} ${BFL_LIBRARIES} ${BULLET_LIBRARIES}
61 | )
62 |
63 | if(CATKIN_ENABLE_TESTING)
64 | find_package(catkin REQUIRED COMPONENTS roslaunch roslint)
65 | roslaunch_add_file_check(launch)
66 | roslint_cpp()
67 | roslint_add_test()
68 | endif()
69 |
70 | install(TARGETS leg_detector
71 | RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
72 | )
73 |
74 | install(FILES config/trained_leg_detector.yaml
75 | DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/config
76 | )
77 |
78 | install(DIRECTORY launch/
79 | DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch
80 | )
81 |
82 | install(DIRECTORY include/${PROJECT_NAME}/
83 | DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
84 | )
85 |
--------------------------------------------------------------------------------
/leg_detector/include/leg_detector/calc_leg_features.h:
--------------------------------------------------------------------------------
1 | /*********************************************************************
2 | * Software License Agreement (BSD License)
3 | *
4 | * Copyright (c) 2008, Willow Garage, Inc.
5 | * All rights reserved.
6 | *
7 | * Redistribution and use in source and binary forms, with or without
8 | * modification, are permitted provided that the following conditions
9 | * are met:
10 | *
11 | * * Redistributions of source code must retain the above copyright
12 | * notice, this list of conditions and the following disclaimer.
13 | * * Redistributions in binary form must reproduce the above
14 | * copyright notice, this list of conditions and the following
15 | * disclaimer in the documentation and/or other materials provided
16 | * with the distribution.
17 | * * Neither the name of the Willow Garage nor the names of its
18 | * contributors may be used to endorse or promote products derived
19 | * from this software without specific prior written permission.
20 | *
21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 | * POSSIBILITY OF SUCH DAMAGE.
33 | *********************************************************************/
34 |
35 | #ifndef LEG_DETECTOR_CALC_LEG_FEATURES_H
36 | #define LEG_DETECTOR_CALC_LEG_FEATURES_H
37 |
38 | #include
39 | #include
40 | #include
41 |
42 | // TODO(dlu): Should remove scan dependency from here.
43 | // Only used for jump distance
44 | std::vector calcLegFeatures(laser_processor::SampleSet* cluster, const sensor_msgs::LaserScan& scan);
45 |
46 | #endif // LEG_DETECTOR_CALC_LEG_FEATURES_H
47 |
--------------------------------------------------------------------------------
/face_detector/mainpage.dox:
--------------------------------------------------------------------------------
1 | /**
2 | \mainpage
3 | \htmlinclude manifest.html
4 |
5 | \b face_detector is a package containing algorithms and nodes related to the detection of faces.
6 |
7 | @section usage Usage
8 | See the launch files for examples. launch/face_dector..launch launches in continuous detection mode, and
9 | launch/face_detector_action..launch launches as an action.
10 |
11 | @param classifier_name A readable string name for the classifier. Will be published with the result.
12 | @param classifier_filename Full path to the trained haar cascade. Currently useful cascades are haar_frontalface_alt.xml and haar_profileface.xml in opencv2
13 | @param classifier_reliability Double 0-1. Some notion of the classifier's reliability for use in a larger system.
14 | @param do_continuous true = Run continuously. false = Wait for action call.
15 | @param do_publish_faces_of_unknown_size true = If depth info is not available, publish the resulting face with a position of (0,0,0). false = Don't publish faces if stereo information isn't available.
16 | @param do_display false = Don't display anything. true = Display detections in an OpenCV highgui window.
17 | @param face_size_min_m Double. The minimum width of a face, in meters. Defaults to 0.1m.
18 | @param face_size_max_m Double. The maximum width of a face, in meters. Defaults to 0.5m.
19 | @param max_face_z_m Double. The maximum distance of a face from the camera, in meters. (In the camera frame, depth is along the z-axis.) Defaults to 8.0m.
20 | @param face_separation_dist_m Double. Only used for tracking. The maximum distance between two face detections before they are considered different faces. Defaults to 1.0m.
21 | @param use_rgbd Double. true = use data from an RGBD camera (like the Kinect), false = use stereo data
22 | @param approximate_sync. true = use data from unsynchronized image-depth pairs (Kinect), false = use data from synchronized image-depth pairs (stereo)
23 |
24 |
25 |
26 | \section codeapi Code API
27 |
28 |
38 |
39 |
40 | */
41 |
--------------------------------------------------------------------------------
/leg_detector/CHANGELOG.rst:
--------------------------------------------------------------------------------
1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 | Changelog for package leg_detector
3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4 |
5 | 1.2.0 (2019-08-19)
6 | ------------------
7 | * Cleanup (`#73 `_)
8 | * General code cleanup (standard headers, whitespace, linting)
9 | * Contributors: David V. Lu!!
10 |
11 | 1.0.9 (2015-09-01)
12 | ------------------
13 | * Fix handling of scans with negative angle increment
14 | For laser sensors which are mounted upside down. Old code did not generate any clusters in that case.
15 | * Contributors: Timm Linder
16 |
17 | 1.0.8 (2014-12-10)
18 | ------------------
19 | * cleanup formatting with astyle (supersedes `#18 `_)
20 | * Contributors: Dan Lazewatsky
21 |
22 | 1.0.4 (2014-07-09)
23 | ------------------
24 | * Merging leg_detector into people
25 | * Contributors: David Lu!!
26 |
27 | 1.0.3 (2014-03-01)
28 | ------------------
29 |
30 | 1.0.2 (2014-02-28)
31 | ------------------
32 |
33 | 1.0.1 (2014-02-27)
34 | ------------------
35 | * height_tracker --> people_experimental
36 | git-svn-id: https://code.ros.org/svn/wg-ros-pkg/trunk/stacks/people@40194 7275ad9f-c29b-430a-bdc5-66f4b3af1622
37 | * Added platform tags for Ubuntu 9.04, 9.10, and 10.04.
38 | git-svn-id: https://code.ros.org/svn/wg-ros-pkg/trunk/stacks/people@36945 7275ad9f-c29b-430a-bdc5-66f4b3af1622
39 | * Unblacklisting
40 | git-svn-id: https://code.ros.org/svn/wg-ros-pkg/trunk/stacks/people@33043 7275ad9f-c29b-430a-bdc5-66f4b3af1622
41 | * removed a number of dependencies
42 | git-svn-id: https://code.ros.org/svn/wg-ros-pkg/trunk/stacks/people@32910 7275ad9f-c29b-430a-bdc5-66f4b3af1622
43 | * git-svn-id: https://code.ros.org/svn/wg-ros-pkg/trunk/stacks/people@32909 7275ad9f-c29b-430a-bdc5-66f4b3af1622
44 | * people: blacklisting packages due to deprecated deps
45 | git-svn-id: https://code.ros.org/svn/wg-ros-pkg/trunk/stacks/people@32439 7275ad9f-c29b-430a-bdc5-66f4b3af1622
46 | * leg detector from people_package --> leg_detector
47 | git-svn-id: https://code.ros.org/svn/wg-ros-pkg/trunk/stacks/people@32067 7275ad9f-c29b-430a-bdc5-66f4b3af1622
48 | * moved the filter into the filter package
49 | git-svn-id: https://code.ros.org/svn/wg-ros-pkg/trunk/stacks/people@31998 7275ad9f-c29b-430a-bdc5-66f4b3af1622
50 | * empty packages that will eventually hold the stuff in people_package
51 | git-svn-id: https://code.ros.org/svn/wg-ros-pkg/trunk/stacks/people@31910 7275ad9f-c29b-430a-bdc5-66f4b3af1622
52 | * Contributors: Brian Gerkey, Caroline Pantofaru, Ken Conley
53 |
--------------------------------------------------------------------------------
/people_tracking_filter/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 2.8.3)
2 | project(people_tracking_filter)
3 |
4 | # Look for bfl (Bayesian Filtering Library)
5 | find_package(PkgConfig)
6 | pkg_check_modules(BFL REQUIRED orocos-bfl)
7 | link_directories(${BFL_LIBRARY_DIRS})
8 |
9 | find_package(catkin REQUIRED COMPONENTS
10 | geometry_msgs
11 | message_filters
12 | people_msgs
13 | roscpp
14 | sensor_msgs
15 | std_msgs
16 | tf
17 | )
18 |
19 | find_package(Boost REQUIRED COMPONENTS thread)
20 |
21 | catkin_package(
22 | INCLUDE_DIRS include
23 | CATKIN_DEPENDS
24 | geometry_msgs
25 | message_filters
26 | people_msgs
27 | roscpp
28 | sensor_msgs
29 | std_msgs
30 | tf
31 | LIBRARIES people_tracking_filter
32 | )
33 |
34 | include_directories(
35 | include ${catkin_INCLUDE_DIRS} ${BFL_INCLUDE_DIRS}/bfl
36 | )
37 |
38 | add_library(people_tracking_filter
39 | src/uniform_vector.cpp
40 | src/gaussian_vector.cpp
41 | src/gaussian_pos_vel.cpp
42 | src/mcpdf_pos_vel.cpp
43 | src/mcpdf_vector.cpp
44 | src/sysmodel_pos_vel.cpp
45 | src/sysmodel_vector.cpp
46 | src/measmodel_pos.cpp
47 | src/measmodel_vector.cpp
48 | src/tracker_particle.cpp
49 | src/tracker_kalman.cpp
50 | src/detector_particle.cpp
51 | )
52 | add_dependencies(people_tracking_filter ${catkin_EXPORTED_TARGETS})
53 | target_link_libraries(people_tracking_filter ${catkin_LIBRARIES} ${Boost_LIBRARIES} ${BFL_LIBRARIES})
54 |
55 | add_executable(people_tracker src/people_tracking_node.cpp)
56 | add_dependencies(people_tracker people_tracking_filter ${catkin_EXPORTED_TARGETS})
57 | target_link_libraries(people_tracker
58 | people_tracking_filter ${catkin_LIBRARIES} ${Boost_LIBRARIES} ${BFL_LIBRARIES}
59 | )
60 |
61 | if(CATKIN_ENABLE_TESTING)
62 | find_package(catkin REQUIRED COMPONENTS roslaunch roslint)
63 | roslaunch_add_file_check(launch)
64 | roslint_cpp()
65 | roslint_add_test()
66 | endif()
67 |
68 | install(TARGETS people_tracking_filter
69 | ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
70 | LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
71 | RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION}
72 | )
73 | install(TARGETS people_tracker
74 | RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
75 | )
76 | install(DIRECTORY include/${PROJECT_NAME}/
77 | DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
78 | )
79 | install(DIRECTORY launch
80 | DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
81 | )
82 |
--------------------------------------------------------------------------------
/people_tracking_filter/include/people_tracking_filter/mcpdf_vector.h:
--------------------------------------------------------------------------------
1 | /*********************************************************************
2 | * Software License Agreement (BSD License)
3 | *
4 | * Copyright (c) 2008, Willow Garage, Inc.
5 | * All rights reserved.
6 | *
7 | * Redistribution and use in source and binary forms, with or without
8 | * modification, are permitted provided that the following conditions
9 | * are met:
10 | *
11 | * * Redistributions of source code must retain the above copyright
12 | * notice, this list of conditions and the following disclaimer.
13 | * * Redistributions in binary form must reproduce the above
14 | * copyright notice, this list of conditions and the following
15 | * disclaimer in the documentation and/or other materials provided
16 | * with the distribution.
17 | * * Neither the name of the Willow Garage nor the names of its
18 | * contributors may be used to endorse or promote products derived
19 | * from this software without specific prior written permission.
20 | *
21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 | * POSSIBILITY OF SUCH DAMAGE.
33 | *********************************************************************/
34 |
35 | /* Author: Wim Meeussen */
36 |
37 | #ifndef PEOPLE_TRACKING_FILTER_MCPDF_VECTOR_H
38 | #define PEOPLE_TRACKING_FILTER_MCPDF_VECTOR_H
39 |
40 | #include
41 | #include
42 | #include
43 |
44 | namespace BFL
45 | {
46 | /// Class representing a vector mcpdf
47 | class MCPdfVector: public MCPdf
48 | {
49 | public:
50 | /// Constructor
51 | explicit MCPdfVector(unsigned int num_samples);
52 |
53 | /// Destructor
54 | virtual ~MCPdfVector();
55 |
56 | /// Get evenly distributed particle cloud
57 | void getParticleCloud(const tf::Vector3& step, double threshold, sensor_msgs::PointCloud& cloud) const;
58 |
59 | /// Get pos histogram from certain area
60 | MatrixWrapper::Matrix getHistogram(const tf::Vector3& min, const tf::Vector3& max, const tf::Vector3& step) const;
61 |
62 | virtual tf::Vector3 ExpectedValueGet() const;
63 | virtual WeightedSample SampleGet(unsigned int particle) const;
64 | virtual unsigned int numParticlesGet() const;
65 | };
66 | } // end namespace BFL
67 | #endif // PEOPLE_TRACKING_FILTER_MCPDF_VECTOR_H
68 |
--------------------------------------------------------------------------------
/people_tracking_filter/include/people_tracking_filter/state_pos_vel.h:
--------------------------------------------------------------------------------
1 | /*********************************************************************
2 | * Software License Agreement (BSD License)
3 | *
4 | * Copyright (c) 2008, Willow Garage, Inc.
5 | * All rights reserved.
6 | *
7 | * Redistribution and use in source and binary forms, with or without
8 | * modification, are permitted provided that the following conditions
9 | * are met:
10 | *
11 | * * Redistributions of source code must retain the above copyright
12 | * notice, this list of conditions and the following disclaimer.
13 | * * Redistributions in binary form must reproduce the above
14 | * copyright notice, this list of conditions and the following
15 | * disclaimer in the documentation and/or other materials provided
16 | * with the distribution.
17 | * * Neither the name of the Willow Garage nor the names of its
18 | * contributors may be used to endorse or promote products derived
19 | * from this software without specific prior written permission.
20 | *
21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 | * POSSIBILITY OF SUCH DAMAGE.
33 | *********************************************************************/
34 |
35 | /* Author: Wim Meeussen */
36 |
37 |
38 | #ifndef PEOPLE_TRACKING_FILTER_STATE_POS_VEL_H
39 | #define PEOPLE_TRACKING_FILTER_STATE_POS_VEL_H
40 |
41 | #include
42 |
43 | namespace BFL
44 | {
45 | /// Class representing state with pos and vel
46 | class StatePosVel
47 | {
48 | public:
49 | tf::Vector3 pos_, vel_;
50 |
51 | /// Constructor
52 | StatePosVel(const tf::Vector3& pos = tf::Vector3(0, 0, 0),
53 | const tf::Vector3& vel = tf::Vector3(0, 0, 0)): pos_(pos), vel_(vel) {}
54 |
55 | /// Destructor
56 | ~StatePosVel() {}
57 |
58 | /// operator +=
59 | StatePosVel& operator += (const StatePosVel& s)
60 | {
61 | this->pos_ += s.pos_;
62 | this->vel_ += s.vel_;
63 | return *this;
64 | }
65 |
66 | /// operator +
67 | StatePosVel operator + (const StatePosVel& s)
68 | {
69 | StatePosVel res;
70 |
71 | res.pos_ = this->pos_ + s.pos_;
72 | res.vel_ = this->vel_ + s.vel_;
73 | return res;
74 | }
75 |
76 | /// output stream for StatePosVel
77 | friend std::ostream& operator<< (std::ostream& os, const StatePosVel& s)
78 | {
79 | os << "(" << s.pos_[0] << ", " << s.pos_[1] << ", " << s.pos_[2] << ")--("
80 | << "(" << s.vel_[0] << ", " << s.vel_[1] << ", " << s.vel_[2] << ") ";
81 | return os;
82 | };
83 | };
84 | } // end namespace BFL
85 | #endif // PEOPLE_TRACKING_FILTER_STATE_POS_VEL_H
86 |
--------------------------------------------------------------------------------
/people_tracking_filter/include/people_tracking_filter/uniform_vector.h:
--------------------------------------------------------------------------------
1 | /*********************************************************************
2 | * Software License Agreement (BSD License)
3 | *
4 | * Copyright (c) 2008, Willow Garage, Inc.
5 | * All rights reserved.
6 | *
7 | * Redistribution and use in source and binary forms, with or without
8 | * modification, are permitted provided that the following conditions
9 | * are met:
10 | *
11 | * * Redistributions of source code must retain the above copyright
12 | * notice, this list of conditions and the following disclaimer.
13 | * * Redistributions in binary form must reproduce the above
14 | * copyright notice, this list of conditions and the following
15 | * disclaimer in the documentation and/or other materials provided
16 | * with the distribution.
17 | * * Neither the name of the Willow Garage nor the names of its
18 | * contributors may be used to endorse or promote products derived
19 | * from this software without specific prior written permission.
20 | *
21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 | * POSSIBILITY OF SUCH DAMAGE.
33 | *********************************************************************/
34 |
35 | /* Author: Wim Meeussen */
36 |
37 | #ifndef PEOPLE_TRACKING_FILTER_UNIFORM_VECTOR_H
38 | #define PEOPLE_TRACKING_FILTER_UNIFORM_VECTOR_H
39 |
40 | #include
41 | #include
42 | #include
43 |
44 | namespace BFL
45 | {
46 | /// Class representing uniform vector
47 | class UniformVector: public Pdf
48 | {
49 | private:
50 | tf::Vector3 mu_, size_;
51 | double probability_;
52 |
53 | public:
54 | /// Constructor
55 | UniformVector(const tf::Vector3& mu, const tf::Vector3& size);
56 |
57 | /// Destructor
58 | virtual ~UniformVector();
59 |
60 | /// output stream for UniformVector
61 | friend std::ostream& operator<< (std::ostream& os, const UniformVector& g);
62 |
63 | // Redefinition of pure virtuals
64 | virtual UniformVector* Clone() const;
65 |
66 | // Redefinition of pure virtuals
67 | virtual Probability ProbabilityGet(const tf::Vector3& input) const;
68 | bool SampleFrom(vector >& list_samples, const int num_samples, int method = DEFAULT,
69 | void * args = NULL) const;
70 | virtual bool SampleFrom(Sample& one_sample, int method = DEFAULT, void * args = NULL) const;
71 |
72 | virtual tf::Vector3 ExpectedValueGet() const;
73 | virtual MatrixWrapper::SymmetricMatrix CovarianceGet() const;
74 | };
75 | } // namespace BFL
76 | #endif // PEOPLE_TRACKING_FILTER_UNIFORM_VECTOR_H
77 |
--------------------------------------------------------------------------------
/people_tracking_filter/include/people_tracking_filter/gaussian_vector.h:
--------------------------------------------------------------------------------
1 | /*********************************************************************
2 | * Software License Agreement (BSD License)
3 | *
4 | * Copyright (c) 2008, Willow Garage, Inc.
5 | * All rights reserved.
6 | *
7 | * Redistribution and use in source and binary forms, with or without
8 | * modification, are permitted provided that the following conditions
9 | * are met:
10 | *
11 | * * Redistributions of source code must retain the above copyright
12 | * notice, this list of conditions and the following disclaimer.
13 | * * Redistributions in binary form must reproduce the above
14 | * copyright notice, this list of conditions and the following
15 | * disclaimer in the documentation and/or other materials provided
16 | * with the distribution.
17 | * * Neither the name of the Willow Garage nor the names of its
18 | * contributors may be used to endorse or promote products derived
19 | * from this software without specific prior written permission.
20 | *
21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 | * POSSIBILITY OF SUCH DAMAGE.
33 | *********************************************************************/
34 |
35 | /* Author: Wim Meeussen */
36 |
37 | #ifndef PEOPLE_TRACKING_FILTER_GAUSSIAN_VECTOR_H
38 | #define PEOPLE_TRACKING_FILTER_GAUSSIAN_VECTOR_H
39 |
40 | #include
41 | #include
42 | #include
43 |
44 | namespace BFL
45 | {
46 | /// Class representing gaussian vector
47 | class GaussianVector: public Pdf
48 | {
49 | private:
50 | tf::Vector3 mu_, sigma_;
51 | mutable double sqrt_;
52 | mutable tf::Vector3 sigma_sq_;
53 | mutable bool sigma_changed_;
54 |
55 | public:
56 | /// Constructor
57 | GaussianVector(const tf::Vector3& mu, const tf::Vector3& sigma);
58 |
59 | /// Destructor
60 | virtual ~GaussianVector();
61 |
62 | /// output stream for GaussianVector
63 | friend std::ostream& operator<< (std::ostream& os, const GaussianVector& g);
64 |
65 | void sigmaSet(const tf::Vector3& sigma);
66 |
67 | // Redefinition of pure virtuals
68 | virtual Probability ProbabilityGet(const tf::Vector3& input) const;
69 | bool SampleFrom(vector >& list_samples, const int num_samples, int method = DEFAULT,
70 | void * args = NULL) const;
71 | virtual bool SampleFrom(Sample& one_sample, int method = DEFAULT, void * args = NULL) const;
72 |
73 | virtual tf::Vector3 ExpectedValueGet() const;
74 | virtual MatrixWrapper::SymmetricMatrix CovarianceGet() const;
75 |
76 | virtual GaussianVector* Clone() const;
77 | };
78 | } // end namespace BFL
79 | #endif // PEOPLE_TRACKING_FILTER_GAUSSIAN_VECTOR_H
80 |
--------------------------------------------------------------------------------
/people_tracking_filter/include/people_tracking_filter/mcpdf_pos_vel.h:
--------------------------------------------------------------------------------
1 | /*********************************************************************
2 | * Software License Agreement (BSD License)
3 | *
4 | * Copyright (c) 2008, Willow Garage, Inc.
5 | * All rights reserved.
6 | *
7 | * Redistribution and use in source and binary forms, with or without
8 | * modification, are permitted provided that the following conditions
9 | * are met:
10 | *
11 | * * Redistributions of source code must retain the above copyright
12 | * notice, this list of conditions and the following disclaimer.
13 | * * Redistributions in binary form must reproduce the above
14 | * copyright notice, this list of conditions and the following
15 | * disclaimer in the documentation and/or other materials provided
16 | * with the distribution.
17 | * * Neither the name of the Willow Garage nor the names of its
18 | * contributors may be used to endorse or promote products derived
19 | * from this software without specific prior written permission.
20 | *
21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 | * POSSIBILITY OF SUCH DAMAGE.
33 | *********************************************************************/
34 |
35 | /* Author: Wim Meeussen */
36 |
37 | #ifndef PEOPLE_TRACKING_FILTER_MCPDF_POS_VEL_H
38 | #define PEOPLE_TRACKING_FILTER_MCPDF_POS_VEL_H
39 |
40 | #include
41 | #include
42 | #include
43 | #include
44 |
45 | namespace BFL
46 | {
47 | /// Class representing a posvel mcpdf
48 | class MCPdfPosVel: public MCPdf
49 | {
50 | public:
51 | /// Constructor
52 | explicit MCPdfPosVel(unsigned int num_samples);
53 |
54 | /// Destructor
55 | virtual ~MCPdfPosVel();
56 |
57 | /// Get evenly distributed particle cloud
58 | void getParticleCloud(const tf::Vector3& step, double threshold, sensor_msgs::PointCloud& cloud) const;
59 |
60 | /// Get pos histogram from certain area
61 | MatrixWrapper::Matrix getHistogramPos(const tf::Vector3& min, const tf::Vector3& max, const tf::Vector3& step) const;
62 |
63 | /// Get vel histogram from certain area
64 | MatrixWrapper::Matrix getHistogramVel(const tf::Vector3& min, const tf::Vector3& max, const tf::Vector3& step) const;
65 |
66 | virtual StatePosVel ExpectedValueGet() const;
67 | virtual WeightedSample SampleGet(unsigned int particle) const;
68 | virtual unsigned int numParticlesGet() const;
69 |
70 | private:
71 | /// Get histogram from certain area
72 | MatrixWrapper::Matrix getHistogram(const tf::Vector3& min, const tf::Vector3& max, const tf::Vector3& step,
73 | bool pos_hist) const;
74 | };
75 | } // end namespace BFL
76 | #endif // PEOPLE_TRACKING_FILTER_MCPDF_POS_VEL_H
77 |
--------------------------------------------------------------------------------
/people_tracking_filter/include/people_tracking_filter/gaussian_pos_vel.h:
--------------------------------------------------------------------------------
1 | /*********************************************************************
2 | * Software License Agreement (BSD License)
3 | *
4 | * Copyright (c) 2008, Willow Garage, Inc.
5 | * All rights reserved.
6 | *
7 | * Redistribution and use in source and binary forms, with or without
8 | * modification, are permitted provided that the following conditions
9 | * are met:
10 | *
11 | * * Redistributions of source code must retain the above copyright
12 | * notice, this list of conditions and the following disclaimer.
13 | * * Redistributions in binary form must reproduce the above
14 | * copyright notice, this list of conditions and the following
15 | * disclaimer in the documentation and/or other materials provided
16 | * with the distribution.
17 | * * Neither the name of the Willow Garage nor the names of its
18 | * contributors may be used to endorse or promote products derived
19 | * from this software without specific prior written permission.
20 | *
21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 | * POSSIBILITY OF SUCH DAMAGE.
33 | *********************************************************************/
34 |
35 | /* Author: Wim Meeussen */
36 |
37 | #ifndef PEOPLE_TRACKING_FILTER_GAUSSIAN_POS_VEL_H
38 | #define PEOPLE_TRACKING_FILTER_GAUSSIAN_POS_VEL_H
39 |
40 | #include
41 | #include
42 | #include
43 | #include
44 |
45 | namespace BFL
46 | {
47 | /// Class representing gaussian pos_vel
48 | class GaussianPosVel: public Pdf
49 | {
50 | private:
51 | StatePosVel mu_, sigma_;
52 | GaussianVector gauss_pos_, gauss_vel_;
53 | mutable double dt_;
54 |
55 | public:
56 | /// Constructor
57 | GaussianPosVel(const StatePosVel& mu, const StatePosVel& sigma);
58 |
59 | /// Destructor
60 | virtual ~GaussianPosVel();
61 |
62 | /// clone function
63 | virtual GaussianPosVel* Clone() const;
64 |
65 | /// output stream for GaussianPosVel
66 | friend std::ostream& operator<< (std::ostream& os, const GaussianPosVel& g);
67 |
68 | // set time
69 | void SetDt(double dt) const
70 | {
71 | dt_ = dt;
72 | };
73 |
74 | // Redefinition of pure virtuals
75 | virtual Probability ProbabilityGet(const StatePosVel& input) const;
76 | bool SampleFrom(vector >& list_samples, const int num_samples, int method = DEFAULT,
77 | void * args = NULL) const;
78 | virtual bool SampleFrom(Sample& one_sample, int method = DEFAULT, void * args = NULL) const;
79 |
80 | virtual StatePosVel ExpectedValueGet() const;
81 | virtual MatrixWrapper::SymmetricMatrix CovarianceGet() const;
82 | };
83 | } // end namespace BFL
84 | #endif // PEOPLE_TRACKING_FILTER_GAUSSIAN_POS_VEL_H
85 |
--------------------------------------------------------------------------------
/people_tracking_filter/src/measmodel_pos.cpp:
--------------------------------------------------------------------------------
1 | /*********************************************************************
2 | * Software License Agreement (BSD License)
3 | *
4 | * Copyright (c) 2008, Willow Garage, Inc.
5 | * All rights reserved.
6 | *
7 | * Redistribution and use in source and binary forms, with or without
8 | * modification, are permitted provided that the following conditions
9 | * are met:
10 | *
11 | * * Redistributions of source code must retain the above copyright
12 | * notice, this list of conditions and the following disclaimer.
13 | * * Redistributions in binary form must reproduce the above
14 | * copyright notice, this list of conditions and the following
15 | * disclaimer in the documentation and/or other materials provided
16 | * with the distribution.
17 | * * Neither the name of the Willow Garage nor the names of its
18 | * contributors may be used to endorse or promote products derived
19 | * from this software without specific prior written permission.
20 | *
21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 | * POSSIBILITY OF SUCH DAMAGE.
33 | *********************************************************************/
34 |
35 | /* Author: Wim Meeussen */
36 |
37 | #include
38 |
39 | namespace BFL
40 | {
41 | static const unsigned int NUM_MEASMODEL_POS_COND_ARGS = 1;
42 | static const unsigned int DIM_MEASMODEL_POS = 13;
43 |
44 | // Constructor
45 | MeasPdfPos::MeasPdfPos(const tf::Vector3& sigma)
46 | : ConditionalPdf(DIM_MEASMODEL_POS, NUM_MEASMODEL_POS_COND_ARGS),
47 | meas_noise_(tf::Vector3(0, 0, 0), sigma)
48 | {}
49 |
50 | // Destructor
51 | MeasPdfPos::~MeasPdfPos()
52 | {}
53 |
54 | Probability
55 | MeasPdfPos::ProbabilityGet(const tf::Vector3& measurement) const
56 | {
57 | return meas_noise_.ProbabilityGet(measurement - ConditionalArgumentGet(0).pos_);
58 | }
59 |
60 | bool
61 | MeasPdfPos::SampleFrom(Sample& one_sample, int method, void *args) const
62 | {
63 | std::cerr << "MeasPdfPos::SampleFrom Method not applicable" << std::endl;
64 | assert(0);
65 | return false;
66 | }
67 |
68 | tf::Vector3
69 | MeasPdfPos::ExpectedValueGet() const
70 | {
71 | std::cerr << "MeasPdfPos::ExpectedValueGet Method not applicable" << std::endl;
72 | tf::Vector3 result;
73 | assert(0);
74 | return result;
75 | }
76 |
77 | SymmetricMatrix
78 | MeasPdfPos::CovarianceGet() const
79 | {
80 | std::cerr << "MeasPdfPos::CovarianceGet Method not applicable" << std::endl;
81 | SymmetricMatrix Covar(DIM_MEASMODEL_POS);
82 | assert(0);
83 | return Covar;
84 | }
85 |
86 | void
87 | MeasPdfPos::CovarianceSet(const MatrixWrapper::SymmetricMatrix& cov)
88 | {
89 | tf::Vector3 cov_vec(sqrt(cov(1, 1)), sqrt(cov(2, 2)), sqrt(cov(3, 3)));
90 | meas_noise_.sigmaSet(cov_vec);
91 | }
92 | } // namespace BFL
93 |
--------------------------------------------------------------------------------
/people_tracking_filter/src/sysmodel_vector.cpp:
--------------------------------------------------------------------------------
1 | /*********************************************************************
2 | * Software License Agreement (BSD License)
3 | *
4 | * Copyright (c) 2008, Willow Garage, Inc.
5 | * All rights reserved.
6 | *
7 | * Redistribution and use in source and binary forms, with or without
8 | * modification, are permitted provided that the following conditions
9 | * are met:
10 | *
11 | * * Redistributions of source code must retain the above copyright
12 | * notice, this list of conditions and the following disclaimer.
13 | * * Redistributions in binary form must reproduce the above
14 | * copyright notice, this list of conditions and the following
15 | * disclaimer in the documentation and/or other materials provided
16 | * with the distribution.
17 | * * Neither the name of the Willow Garage nor the names of its
18 | * contributors may be used to endorse or promote products derived
19 | * from this software without specific prior written permission.
20 | *
21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 | * POSSIBILITY OF SUCH DAMAGE.
33 | *********************************************************************/
34 |
35 | /* Author: Wim Meeussen */
36 |
37 | #include
38 |
39 | static const unsigned int NUM_SYS_VECTOR_COND_ARGS = 1;
40 | static const unsigned int DIM_SYS_VECTOR = 3;
41 |
42 | namespace BFL
43 | {
44 | // Constructor
45 | SysPdfVector::SysPdfVector(const tf::Vector3& sigma)
46 | : ConditionalPdf(DIM_SYS_VECTOR, NUM_SYS_VECTOR_COND_ARGS),
47 | noise_(tf::Vector3(0, 0, 0), sigma)
48 | {}
49 |
50 | // Destructor
51 | SysPdfVector::~SysPdfVector()
52 | {}
53 |
54 | Probability
55 | SysPdfVector::ProbabilityGet(const tf::Vector3& state) const
56 | {
57 | std::cerr << "SysPdfVector::ProbabilityGet Method not applicable" << std::endl;
58 | assert(0);
59 | return 0;
60 | }
61 |
62 | bool
63 | SysPdfVector::SampleFrom(Sample& one_sample, int method, void *args) const
64 | {
65 | tf::Vector3& res = one_sample.ValueGet();
66 |
67 | // get conditional argument: state
68 | res = this->ConditionalArgumentGet(0);
69 |
70 | // add noise
71 | Sample noise_sample;
72 | noise_.SampleFrom(noise_sample, method, args);
73 | res += noise_sample.ValueGet();
74 |
75 | return true;
76 | }
77 |
78 | tf::Vector3
79 | SysPdfVector::ExpectedValueGet() const
80 | {
81 | std::cerr << "SysPdfVector::ExpectedValueGet Method not applicable" << std::endl;
82 | assert(0);
83 | return tf::Vector3();
84 | }
85 |
86 | SymmetricMatrix
87 | SysPdfVector::CovarianceGet() const
88 | {
89 | std::cerr << "SysPdfVector::CovarianceGet Method not applicable" << std::endl;
90 | SymmetricMatrix Covar(DIM_SYS_VECTOR);
91 | assert(0);
92 | return Covar;
93 | }
94 | } // namespace BFL
95 |
--------------------------------------------------------------------------------
/people_tracking_filter/src/measmodel_vector.cpp:
--------------------------------------------------------------------------------
1 | /*********************************************************************
2 | * Software License Agreement (BSD License)
3 | *
4 | * Copyright (c) 2008, Willow Garage, Inc.
5 | * All rights reserved.
6 | *
7 | * Redistribution and use in source and binary forms, with or without
8 | * modification, are permitted provided that the following conditions
9 | * are met:
10 | *
11 | * * Redistributions of source code must retain the above copyright
12 | * notice, this list of conditions and the following disclaimer.
13 | * * Redistributions in binary form must reproduce the above
14 | * copyright notice, this list of conditions and the following
15 | * disclaimer in the documentation and/or other materials provided
16 | * with the distribution.
17 | * * Neither the name of the Willow Garage nor the names of its
18 | * contributors may be used to endorse or promote products derived
19 | * from this software without specific prior written permission.
20 | *
21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 | * POSSIBILITY OF SUCH DAMAGE.
33 | *********************************************************************/
34 |
35 | /* Author: Wim Meeussen */
36 |
37 | #include
38 |
39 | namespace BFL
40 | {
41 | static const unsigned int NUM_MEASMODEL_VECTOR_COND_ARGS = 1;
42 | static const unsigned int DIM_MEASMODEL_VECTOR = 3;
43 |
44 | // Constructor
45 | MeasPdfVector::MeasPdfVector(const tf::Vector3& sigma)
46 | : ConditionalPdf(DIM_MEASMODEL_VECTOR, NUM_MEASMODEL_VECTOR_COND_ARGS),
47 | meas_noise_(tf::Vector3(0, 0, 0), sigma)
48 | {}
49 |
50 | // Destructor
51 | MeasPdfVector::~MeasPdfVector()
52 | {}
53 |
54 | Probability
55 | MeasPdfVector::ProbabilityGet(const tf::Vector3& measurement) const
56 | {
57 | return meas_noise_.ProbabilityGet(measurement - ConditionalArgumentGet(0));
58 | }
59 |
60 | bool
61 | MeasPdfVector::SampleFrom(Sample& one_sample, int method, void *args) const
62 | {
63 | std::cerr << "MeasPdfVector::SampleFrom Method not applicable" << std::endl;
64 | assert(0);
65 | return false;
66 | }
67 |
68 | tf::Vector3
69 | MeasPdfVector::ExpectedValueGet() const
70 | {
71 | std::cerr << "MeasPdfVector::ExpectedValueGet Method not applicable" << std::endl;
72 | tf::Vector3 result;
73 | assert(0);
74 | return result;
75 | }
76 |
77 | SymmetricMatrix
78 | MeasPdfVector::CovarianceGet() const
79 | {
80 | std::cerr << "MeasPdfVector::CovarianceGet Method not applicable" << std::endl;
81 | SymmetricMatrix Covar(DIM_MEASMODEL_VECTOR);
82 | assert(0);
83 | return Covar;
84 | }
85 |
86 | void
87 | MeasPdfVector::CovarianceSet(const MatrixWrapper::SymmetricMatrix& cov)
88 | {
89 | tf::Vector3 cov_vec(sqrt(cov(1, 1)), sqrt(cov(2, 2)), sqrt(cov(3, 3)));
90 | meas_noise_.sigmaSet(cov_vec);
91 | }
92 | } // namespace BFL
93 |
--------------------------------------------------------------------------------
/people_tracking_filter/include/people_tracking_filter/measmodel_vector.h:
--------------------------------------------------------------------------------
1 | /*********************************************************************
2 | * Software License Agreement (BSD License)
3 | *
4 | * Copyright (c) 2008, Willow Garage, Inc.
5 | * All rights reserved.
6 | *
7 | * Redistribution and use in source and binary forms, with or without
8 | * modification, are permitted provided that the following conditions
9 | * are met:
10 | *
11 | * * Redistributions of source code must retain the above copyright
12 | * notice, this list of conditions and the following disclaimer.
13 | * * Redistributions in binary form must reproduce the above
14 | * copyright notice, this list of conditions and the following
15 | * disclaimer in the documentation and/or other materials provided
16 | * with the distribution.
17 | * * Neither the name of the Willow Garage nor the names of its
18 | * contributors may be used to endorse or promote products derived
19 | * from this software without specific prior written permission.
20 | *
21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 | * POSSIBILITY OF SUCH DAMAGE.
33 | *********************************************************************/
34 |
35 | /* Author: Wim Meeussen */
36 |
37 |
38 | #ifndef PEOPLE_TRACKING_FILTER_MEASMODEL_VECTOR_H
39 | #define PEOPLE_TRACKING_FILTER_MEASMODEL_VECTOR_H
40 |
41 | #include
42 | #include
43 | #include
44 | #include
45 | #include
46 | #include
47 |
48 | namespace BFL
49 | {
50 | class MeasPdfVector
51 | : public BFL::ConditionalPdf
52 | {
53 | public:
54 | /// Constructor
55 | explicit MeasPdfVector(const tf::Vector3& sigma);
56 |
57 | /// Destructor
58 | virtual ~MeasPdfVector();
59 |
60 | // set covariance
61 | void CovarianceSet(const MatrixWrapper::SymmetricMatrix& cov);
62 |
63 | // Redefining pure virtual methods
64 | virtual BFL::Probability ProbabilityGet(const tf::Vector3& input) const;
65 | virtual bool SampleFrom(BFL::Sample& one_sample, int method, void *args) const; // Not applicable
66 | virtual tf::Vector3 ExpectedValueGet() const; // Not applicable
67 | virtual MatrixWrapper::SymmetricMatrix CovarianceGet() const; // Not applicable
68 |
69 | private:
70 | GaussianVector meas_noise_;
71 | }; // class
72 |
73 | class MeasModelVector
74 | : public BFL::MeasurementModel
75 | {
76 | public:
77 | /// constructor
78 | explicit MeasModelVector(const tf::Vector3& sigma)
79 | : BFL::MeasurementModel(new MeasPdfVector(sigma))
80 | {};
81 |
82 | /// destructor
83 | ~MeasModelVector()
84 | {
85 | delete MeasurementPdfGet();
86 | };
87 | }; // class
88 | } // namespace BFL
89 | #endif // PEOPLE_TRACKING_FILTER_MEASMODEL_VECTOR_H
90 |
--------------------------------------------------------------------------------
/people_tracking_filter/include/people_tracking_filter/measmodel_pos.h:
--------------------------------------------------------------------------------
1 | /*********************************************************************
2 | * Software License Agreement (BSD License)
3 | *
4 | * Copyright (c) 2008, Willow Garage, Inc.
5 | * All rights reserved.
6 | *
7 | * Redistribution and use in source and binary forms, with or without
8 | * modification, are permitted provided that the following conditions
9 | * are met:
10 | *
11 | * * Redistributions of source code must retain the above copyright
12 | * notice, this list of conditions and the following disclaimer.
13 | * * Redistributions in binary form must reproduce the above
14 | * copyright notice, this list of conditions and the following
15 | * disclaimer in the documentation and/or other materials provided
16 | * with the distribution.
17 | * * Neither the name of the Willow Garage nor the names of its
18 | * contributors may be used to endorse or promote products derived
19 | * from this software without specific prior written permission.
20 | *
21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 | * POSSIBILITY OF SUCH DAMAGE.
33 | *********************************************************************/
34 |
35 | /* Author: Wim Meeussen */
36 |
37 | #ifndef PEOPLE_TRACKING_FILTER_MEASMODEL_POS_H
38 | #define PEOPLE_TRACKING_FILTER_MEASMODEL_POS_H
39 |
40 | #include
41 | #include
42 | #include
43 | #include
44 | #include
45 | #include
46 | #include
47 |
48 | namespace BFL
49 | {
50 | class MeasPdfPos
51 | : public BFL::ConditionalPdf
52 | {
53 | public:
54 | /// Constructor
55 | explicit MeasPdfPos(const tf::Vector3& sigma);
56 |
57 | /// Destructor
58 | virtual ~MeasPdfPos();
59 |
60 | // set covariance
61 | void CovarianceSet(const MatrixWrapper::SymmetricMatrix& cov);
62 |
63 | // Redefining pure virtual methods
64 | virtual BFL::Probability ProbabilityGet(const tf::Vector3& input) const;
65 | virtual bool SampleFrom(BFL::Sample& one_sample, int method, void *args) const; // Not applicable
66 | virtual tf::Vector3 ExpectedValueGet() const; // Not applicable
67 | virtual MatrixWrapper::SymmetricMatrix CovarianceGet() const; // Not applicable
68 |
69 | private:
70 | GaussianVector meas_noise_;
71 | }; // class
72 |
73 | class MeasModelPos
74 | : public BFL::MeasurementModel
75 | {
76 | public:
77 | /// constructor
78 | explicit MeasModelPos(const tf::Vector3& sigma)
79 | : BFL::MeasurementModel(new MeasPdfPos(sigma))
80 | {};
81 |
82 | /// destructor
83 | ~MeasModelPos()
84 | {
85 | delete MeasurementPdfGet();
86 | };
87 | }; // class
88 | } // namespace BFL
89 | #endif // PEOPLE_TRACKING_FILTER_MEASMODEL_POS_H
90 |
--------------------------------------------------------------------------------
/people_tracking_filter/include/people_tracking_filter/sysmodel_vector.h:
--------------------------------------------------------------------------------
1 | /*********************************************************************
2 | * Software License Agreement (BSD License)
3 | *
4 | * Copyright (c) 2008, Willow Garage, Inc.
5 | * All rights reserved.
6 | *
7 | * Redistribution and use in source and binary forms, with or without
8 | * modification, are permitted provided that the following conditions
9 | * are met:
10 | *
11 | * * Redistributions of source code must retain the above copyright
12 | * notice, this list of conditions and the following disclaimer.
13 | * * Redistributions in binary form must reproduce the above
14 | * copyright notice, this list of conditions and the following
15 | * disclaimer in the documentation and/or other materials provided
16 | * with the distribution.
17 | * * Neither the name of the Willow Garage nor the names of its
18 | * contributors may be used to endorse or promote products derived
19 | * from this software without specific prior written permission.
20 | *
21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 | * POSSIBILITY OF SUCH DAMAGE.
33 | *********************************************************************/
34 |
35 | /* Author: Wim Meeussen */
36 |
37 | #ifndef PEOPLE_TRACKING_FILTER_SYSMODEL_VECTOR_H
38 | #define PEOPLE_TRACKING_FILTER_SYSMODEL_VECTOR_H
39 |
40 |
41 | #include
42 | #include
43 | #include
44 | #include
45 | #include
46 |
47 | namespace BFL
48 | {
49 |
50 | class SysPdfVector
51 | : public ConditionalPdf
52 | {
53 | public:
54 | /// Constructor
55 | explicit SysPdfVector(const tf::Vector3& sigma);
56 |
57 | /// Destructor
58 | virtual ~SysPdfVector();
59 |
60 | // set time
61 | void SetDt(double dt)
62 | {
63 | dt_ = dt;
64 | }
65 |
66 | // Redefining pure virtual methods
67 | virtual bool SampleFrom(BFL::Sample& one_sample, int method, void *args) const;
68 | virtual tf::Vector3 ExpectedValueGet() const; // not applicable
69 | virtual Probability ProbabilityGet(const tf::Vector3& state) const; // not applicable
70 | virtual MatrixWrapper::SymmetricMatrix CovarianceGet() const; // Not applicable
71 |
72 | private:
73 | GaussianVector noise_;
74 | double dt_;
75 | }; // class
76 |
77 | class SysModelVector
78 | : public SystemModel
79 | {
80 | public:
81 | explicit SysModelVector(const tf::Vector3& sigma)
82 | : SystemModel(new SysPdfVector(sigma))
83 | {}
84 |
85 | /// destructor
86 | ~SysModelVector()
87 | {
88 | delete SystemPdfGet();
89 | }
90 |
91 | // set time
92 | void SetDt(double dt)
93 | {
94 | static_cast(SystemPdfGet())->SetDt(dt);
95 | }
96 | }; // class
97 | } // namespace BFL
98 | #endif // PEOPLE_TRACKING_FILTER_SYSMODEL_VECTOR_H
99 |
--------------------------------------------------------------------------------
/people_tracking_filter/include/people_tracking_filter/tracker.h:
--------------------------------------------------------------------------------
1 | /*********************************************************************
2 | * Software License Agreement (BSD License)
3 | *
4 | * Copyright (c) 2008, Willow Garage, Inc.
5 | * All rights reserved.
6 | *
7 | * Redistribution and use in source and binary forms, with or without
8 | * modification, are permitted provided that the following conditions
9 | * are met:
10 | *
11 | * * Redistributions of source code must retain the above copyright
12 | * notice, this list of conditions and the following disclaimer.
13 | * * Redistributions in binary form must reproduce the above
14 | * copyright notice, this list of conditions and the following
15 | * disclaimer in the documentation and/or other materials provided
16 | * with the distribution.
17 | * * Neither the name of the Willow Garage nor the names of its
18 | * contributors may be used to endorse or promote products derived
19 | * from this software without specific prior written permission.
20 | *
21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 | * POSSIBILITY OF SUCH DAMAGE.
33 | *********************************************************************/
34 |
35 | /* Author: Wim Meeussen */
36 |
37 | #ifndef PEOPLE_TRACKING_FILTER_TRACKER_H
38 | #define PEOPLE_TRACKING_FILTER_TRACKER_H
39 |
40 | #include
41 | #include
42 | #include
43 | #include
44 |
45 |
46 | namespace estimation
47 | {
48 |
49 | class Tracker
50 | {
51 | public:
52 | /// constructor
53 | explicit Tracker(const std::string& name): name_(name) {}
54 |
55 | /// destructor
56 | virtual ~Tracker() {}
57 |
58 | /// return the name of the tracker
59 | const std::string& getName() const
60 | {
61 | return name_;
62 | };
63 |
64 | /// initialize tracker
65 | virtual void initialize(const BFL::StatePosVel& mu, const BFL::StatePosVel& sigma, const double time) = 0;
66 |
67 | /// return if tracker was initialized
68 | virtual bool isInitialized() const = 0;
69 |
70 | /// return measure for tracker quality: 0=bad 1=good
71 | virtual double getQuality() const = 0;
72 |
73 | /// return the lifetime of the tracker
74 | virtual double getLifetime() const = 0;
75 |
76 | /// return the time of the tracker
77 | virtual double getTime() const = 0;
78 |
79 | /// update tracker
80 | virtual bool updatePrediction(const double time) = 0;
81 | virtual bool updateCorrection(const tf::Vector3& meas,
82 | const MatrixWrapper::SymmetricMatrix& cov) = 0;
83 |
84 | /// get filter posterior
85 | virtual void getEstimate(BFL::StatePosVel& est) const = 0;
86 | virtual void getEstimate(people_msgs::PositionMeasurement& est) const = 0;
87 |
88 | private:
89 | std::string name_;
90 | }; // class
91 | } // namespace estimation
92 | #endif // PEOPLE_TRACKING_FILTER_TRACKER_H
93 |
--------------------------------------------------------------------------------
/people_tracking_filter/include/people_tracking_filter/sysmodel_pos_vel.h:
--------------------------------------------------------------------------------
1 | /*********************************************************************
2 | * Software License Agreement (BSD License)
3 | *
4 | * Copyright (c) 2008, Willow Garage, Inc.
5 | * All rights reserved.
6 | *
7 | * Redistribution and use in source and binary forms, with or without
8 | * modification, are permitted provided that the following conditions
9 | * are met:
10 | *
11 | * * Redistributions of source code must retain the above copyright
12 | * notice, this list of conditions and the following disclaimer.
13 | * * Redistributions in binary form must reproduce the above
14 | * copyright notice, this list of conditions and the following
15 | * disclaimer in the documentation and/or other materials provided
16 | * with the distribution.
17 | * * Neither the name of the Willow Garage nor the names of its
18 | * contributors may be used to endorse or promote products derived
19 | * from this software without specific prior written permission.
20 | *
21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 | * POSSIBILITY OF SUCH DAMAGE.
33 | *********************************************************************/
34 |
35 | /* Author: Wim Meeussen */
36 |
37 | #ifndef PEOPLE_TRACKING_FILTER_SYSMODEL_POS_VEL_H
38 | #define PEOPLE_TRACKING_FILTER_SYSMODEL_POS_VEL_H
39 |
40 |
41 | #include
42 | #include
43 | #include
44 | #include
45 | #include
46 | #include
47 |
48 | namespace BFL
49 | {
50 | class SysPdfPosVel
51 | : public ConditionalPdf
52 | {
53 | public:
54 | /// Constructor
55 | explicit SysPdfPosVel(const StatePosVel& sigma);
56 |
57 | /// Destructor
58 | virtual ~SysPdfPosVel();
59 |
60 | // set time
61 | void SetDt(double dt)
62 | {
63 | dt_ = dt;
64 | }
65 |
66 | // Redefining pure virtual methods
67 | virtual bool SampleFrom(BFL::Sample& one_sample, int method, void *args) const;
68 | virtual StatePosVel ExpectedValueGet() const; // not applicable
69 | virtual Probability ProbabilityGet(const StatePosVel& state) const; // not applicable
70 | virtual MatrixWrapper::SymmetricMatrix CovarianceGet() const; // Not applicable
71 |
72 | private:
73 | GaussianPosVel noise_;
74 | double dt_;
75 | }; // class
76 |
77 | class SysModelPosVel
78 | : public SystemModel
79 | {
80 | public:
81 | explicit SysModelPosVel(const StatePosVel& sigma)
82 | : SystemModel(new SysPdfPosVel(sigma))
83 | {}
84 |
85 | /// destructor
86 | ~SysModelPosVel()
87 | {
88 | delete SystemPdfGet();
89 | }
90 |
91 | // set time
92 | void SetDt(double dt)
93 | {
94 | static_cast(SystemPdfGet())->SetDt(dt);
95 | }
96 | }; // class
97 | } // namespace BFL
98 | #endif // PEOPLE_TRACKING_FILTER_SYSMODEL_POS_VEL_H
99 |
--------------------------------------------------------------------------------
/people_tracking_filter/src/sysmodel_pos_vel.cpp:
--------------------------------------------------------------------------------
1 | /*********************************************************************
2 | * Software License Agreement (BSD License)
3 | *
4 | * Copyright (c) 2008, Willow Garage, Inc.
5 | * All rights reserved.
6 | *
7 | * Redistribution and use in source and binary forms, with or without
8 | * modification, are permitted provided that the following conditions
9 | * are met:
10 | *
11 | * * Redistributions of source code must retain the above copyright
12 | * notice, this list of conditions and the following disclaimer.
13 | * * Redistributions in binary form must reproduce the above
14 | * copyright notice, this list of conditions and the following
15 | * disclaimer in the documentation and/or other materials provided
16 | * with the distribution.
17 | * * Neither the name of the Willow Garage nor the names of its
18 | * contributors may be used to endorse or promote products derived
19 | * from this software without specific prior written permission.
20 | *
21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 | * POSSIBILITY OF SUCH DAMAGE.
33 | *********************************************************************/
34 |
35 | /* Author: Wim Meeussen */
36 |
37 | #include
38 |
39 | namespace BFL
40 | {
41 |
42 | static const unsigned int NUM_SYS_POS_VEL_COND_ARGS = 1;
43 | static const unsigned int DIM_SYS_POS_VEL = 6;
44 |
45 | // Constructor
46 | SysPdfPosVel::SysPdfPosVel(const BFL::StatePosVel& sigma)
47 | : ConditionalPdf(DIM_SYS_POS_VEL, NUM_SYS_POS_VEL_COND_ARGS),
48 | noise_(StatePosVel(tf::Vector3(0, 0, 0), tf::Vector3(0, 0, 0)), sigma)
49 | {}
50 |
51 | // Destructor
52 | SysPdfPosVel::~SysPdfPosVel()
53 | {}
54 |
55 | Probability
56 | SysPdfPosVel::ProbabilityGet(const StatePosVel& state) const
57 | {
58 | std::cerr << "SysPdfPosVel::ProbabilityGet Method not applicable" << std::endl;
59 | assert(0);
60 | return 0;
61 | }
62 |
63 | bool
64 | SysPdfPosVel::SampleFrom(Sample& one_sample, int method, void *args) const
65 | {
66 | StatePosVel& res = one_sample.ValueGet();
67 |
68 | // get conditional argument: state
69 | res = this->ConditionalArgumentGet(0);
70 |
71 | // apply system model
72 | res.pos_ += (res.vel_ * dt_);
73 |
74 | // add noise
75 | Sample noise_sample;
76 | noise_.SetDt(dt_);
77 | noise_.SampleFrom(noise_sample, method, args);
78 | res += noise_sample.ValueGet();
79 |
80 | return true;
81 | }
82 |
83 | StatePosVel
84 | SysPdfPosVel::ExpectedValueGet() const
85 | {
86 | std::cerr << "SysPdfPosVel::ExpectedValueGet Method not applicable" << std::endl;
87 | assert(0);
88 | return StatePosVel();
89 | }
90 |
91 | SymmetricMatrix
92 | SysPdfPosVel::CovarianceGet() const
93 | {
94 | std::cerr << "SysPdfPosVel::CovarianceGet Method not applicable" << std::endl;
95 | SymmetricMatrix Covar(DIM_SYS_POS_VEL);
96 | assert(0);
97 | return Covar;
98 | }
99 | } // namespace BFL
100 |
--------------------------------------------------------------------------------
/face_detector/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 2.8.3)
2 | project(face_detector)
3 |
4 | find_package(catkin REQUIRED COMPONENTS
5 | actionlib
6 | actionlib_msgs
7 | cv_bridge
8 | geometry_msgs
9 | image_geometry
10 | image_transport
11 | message_filters
12 | message_generation
13 | people_msgs
14 | rosbag
15 | roscpp
16 | roslib
17 | rospy
18 | sensor_msgs
19 | std_msgs
20 | std_srvs
21 | stereo_msgs
22 | tf
23 | )
24 |
25 | find_package(Boost REQUIRED COMPONENTS signals system thread)
26 | find_package(OpenCV)
27 |
28 | add_action_files(
29 | DIRECTORY action
30 | FILES FaceDetector.action
31 | )
32 | generate_messages(DEPENDENCIES actionlib_msgs people_msgs)
33 |
34 | catkin_package(
35 | INCLUDE_DIRS include
36 | CATKIN_DEPENDS
37 | actionlib
38 | actionlib_msgs
39 | cv_bridge
40 | geometry_msgs
41 | image_geometry
42 | image_transport
43 | message_filters
44 | message_runtime
45 | people_msgs
46 | roscpp
47 | roslib
48 | rospy
49 | sensor_msgs
50 | std_msgs
51 | stereo_msgs
52 | tf
53 | )
54 |
55 | include_directories(
56 | include
57 | ${Boost_INCLUDE_DIRS}
58 | ${OpenCV_INCLUDE_DIRS}
59 | ${catkin_INCLUDE_DIRS}
60 | )
61 |
62 | add_executable(face_detector
63 | src/face_detection.cpp
64 | src/faces.cpp)
65 | add_dependencies(face_detector ${catkin_EXPORTED_TARGETS} ${${PROJECT_NAME}_EXPORTED_TARGETS})
66 | target_link_libraries(face_detector
67 | ${catkin_LIBRARIES}
68 | ${Boost_LIBRARIES}
69 | ${OpenCV_LIBRARIES})
70 |
71 | install(TARGETS face_detector
72 | RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
73 | )
74 | install(DIRECTORY include/${PROJECT_NAME}/
75 | DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
76 | )
77 |
78 | install(DIRECTORY param
79 | DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/
80 | )
81 | install(DIRECTORY launch
82 | DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/
83 | )
84 |
85 | catkin_install_python(PROGRAMS scripts/face_detector_action_client.py
86 | DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
87 | )
88 |
89 | if(CATKIN_ENABLE_TESTING)
90 | find_package(rostest REQUIRED)
91 | find_package(roslint REQUIRED)
92 | find_package(roslaunch REQUIRED)
93 |
94 | catkin_download_test_data(${PROJECT_NAME}_noface_test_diamondback.bag
95 | http://download.ros.org/data/face_detector/face_detector_noface_test_diamondback.bag
96 | DESTINATION ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}/test
97 | MD5 37f043be780a4511c853379defdd9855)
98 | catkin_download_test_data(${PROJECT_NAME}_withface_test_diamondback.bag
99 | http://download.ros.org/data/face_detector/face_detector_withface_test_diamondback.bag
100 | DESTINATION ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}/test
101 | MD5 59126117e049e69d577b7ee27251a6f8)
102 |
103 | # add_rostest(test/wide-stereo_true_rtest.xml)
104 | # add_rostest(test/wide-stereo_false_rtest.xml)
105 | # add_rostest(test/rgbd_true_rtest.xml)
106 | # add_rostest(test/rgbd_false_rtest.xml)
107 | # add_rostest(test/narrow-stereo_true_rtest.xml)
108 | # add_rostest(test/narrow-stereo_false_rtest.xml)
109 | # add_rostest(test/action-wide_true_rtest.xml)
110 | # add_rostest(test/action-wide_false_rtest.xml)
111 | # add_rostest(test/action-rgbd_true_rtest.xml)
112 | # add_rostest(test/action-rgbd_false_rtest.xml)
113 |
114 | roslint_cpp()
115 | roslaunch_add_file_check(launch)
116 | roslint_python()
117 | roslint_add_test()
118 | endif()
119 |
--------------------------------------------------------------------------------
/people_tracking_filter/include/people_tracking_filter/people_tracking_node.h:
--------------------------------------------------------------------------------
1 | /*********************************************************************
2 | * Software License Agreement (BSD License)
3 | *
4 | * Copyright (c) 2008, Willow Garage, Inc.
5 | * All rights reserved.
6 | *
7 | * Redistribution and use in source and binary forms, with or without
8 | * modification, are permitted provided that the following conditions
9 | * are met:
10 | *
11 | * * Redistributions of source code must retain the above copyright
12 | * notice, this list of conditions and the following disclaimer.
13 | * * Redistributions in binary form must reproduce the above
14 | * copyright notice, this list of conditions and the following
15 | * disclaimer in the documentation and/or other materials provided
16 | * with the distribution.
17 | * * Neither the name of the Willow Garage nor the names of its
18 | * contributors may be used to endorse or promote products derived
19 | * from this software without specific prior written permission.
20 | *
21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 | * POSSIBILITY OF SUCH DAMAGE.
33 | *********************************************************************/
34 |
35 | /* Author: Wim Meeussen */
36 |
37 | #ifndef PEOPLE_TRACKING_FILTER_PEOPLE_TRACKING_NODE_H
38 | #define PEOPLE_TRACKING_FILTER_PEOPLE_TRACKING_NODE_H
39 |
40 | #include
41 | #include
42 | #include
43 |
44 | // ros stuff
45 | #include
46 | #include
47 | #include
48 |
49 | // people tracking stuff
50 | #include
51 | #include
52 | #include
53 |
54 | // messages
55 | #include
56 | #include
57 | #include
58 | #include
59 |
60 | // log files
61 | #include
62 |
63 |
64 | namespace estimation
65 | {
66 |
67 | class PeopleTrackingNode
68 | {
69 | public:
70 | /// constructor
71 | explicit PeopleTrackingNode(ros::NodeHandle nh);
72 |
73 | /// destructor
74 | virtual ~PeopleTrackingNode();
75 |
76 | /// callback for messages
77 | void callbackRcv(const people_msgs::PositionMeasurement::ConstPtr& message);
78 |
79 | /// callback for dropped messages
80 | void callbackDrop(const people_msgs::PositionMeasurement::ConstPtr& message);
81 |
82 | /// tracker loop
83 | void spin();
84 |
85 | private:
86 | ros::NodeHandle nh_;
87 |
88 | ros::Publisher people_filter_pub_;
89 | ros::Publisher people_filter_vis_pub_;
90 | ros::Publisher people_tracker_vis_pub_;
91 |
92 | ros::Subscriber people_meas_sub_;
93 |
94 | /// message sequencer
95 | message_filters::TimeSequencer* message_sequencer_;
96 |
97 | /// trackers
98 | std::list trackers_;
99 |
100 | // tf listener
101 | tf::TransformListener robot_state_;
102 |
103 | unsigned int tracker_counter_;
104 | double freq_, start_distance_min_, reliability_threshold_;
105 | BFL::StatePosVel sys_sigma_;
106 | std::string fixed_frame_;
107 | boost::mutex filter_mutex_;
108 |
109 | sensor_msgs::PointCloud meas_cloud_;
110 | unsigned int meas_visualize_counter_;
111 |
112 | // Track only one person who the robot will follow.
113 | bool follow_one_person_;
114 | }; // class
115 | } // namespace estimation
116 | #endif // PEOPLE_TRACKING_FILTER_PEOPLE_TRACKING_NODE_H
117 |
--------------------------------------------------------------------------------
/people_tracking_filter/src/uniform_vector.cpp:
--------------------------------------------------------------------------------
1 | /*********************************************************************
2 | * Software License Agreement (BSD License)
3 | *
4 | * Copyright (c) 2008, Willow Garage, Inc.
5 | * All rights reserved.
6 | *
7 | * Redistribution and use in source and binary forms, with or without
8 | * modification, are permitted provided that the following conditions
9 | * are met:
10 | *
11 | * * Redistributions of source code must retain the above copyright
12 | * notice, this list of conditions and the following disclaimer.
13 | * * Redistributions in binary form must reproduce the above
14 | * copyright notice, this list of conditions and the following
15 | * disclaimer in the documentation and/or other materials provided
16 | * with the distribution.
17 | * * Neither the name of the Willow Garage nor the names of its
18 | * contributors may be used to endorse or promote products derived
19 | * from this software without specific prior written permission.
20 | *
21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 | * POSSIBILITY OF SUCH DAMAGE.
33 | *********************************************************************/
34 |
35 | /* Author: Wim Meeussen */
36 |
37 | #include
38 | #include
39 | #include
40 | #include
41 | #include
42 |
43 | namespace BFL
44 | {
45 | UniformVector::UniformVector(const tf::Vector3& mu, const tf::Vector3& size)
46 | : Pdf (1),
47 | mu_(mu),
48 | size_(size)
49 | {
50 | for (unsigned int i = 0; i < 3; i++)
51 | assert(size_[i] > 0);
52 |
53 | probability_ = 1 / (size_[0] * 2 * size_[1] * 2 * size_[2] * 2);
54 | }
55 |
56 | UniformVector::~UniformVector() {}
57 |
58 | UniformVector* UniformVector::Clone() const
59 | {
60 | return new UniformVector(mu_, size_);
61 | }
62 |
63 | std::ostream& operator<< (std::ostream& os, const UniformVector& g)
64 | {
65 | os << "Mu :\n" << g.ExpectedValueGet() << endl
66 | << "Size :\n" << g.CovarianceGet() << endl;
67 | return os;
68 | }
69 |
70 | Probability UniformVector::ProbabilityGet(const tf::Vector3& input) const
71 | {
72 | for (unsigned int i = 0; i < 3; i++)
73 | {
74 | if (input[i] < (mu_[0] - (size_[0]))) return 0;
75 | if (input[i] > (mu_[0] + (size_[0]))) return 0;
76 | }
77 | return probability_;
78 | }
79 |
80 | bool
81 | UniformVector::SampleFrom(vector >& list_samples, const int num_samples,
82 | int method, void* args) const
83 | {
84 | list_samples.resize(num_samples);
85 | vector >::iterator sample_it = list_samples.begin();
86 | for (sample_it = list_samples.begin(); sample_it != list_samples.end(); sample_it++)
87 | SampleFrom(*sample_it, method, args);
88 |
89 | return true;
90 | }
91 |
92 | bool
93 | UniformVector::SampleFrom(Sample& one_sample, int method, void * args) const
94 | {
95 | one_sample.ValueSet(tf::Vector3(((runif() - 0.5) * 2 * size_[0]) + mu_[0],
96 | ((runif() - 0.5) * 2 * size_[1]) + mu_[1],
97 | ((runif() - 0.5) * 2 * size_[2]) + mu_[2]));
98 | return true;
99 | }
100 |
101 | tf::Vector3
102 | UniformVector::ExpectedValueGet() const
103 | {
104 | return mu_;
105 | }
106 |
107 | SymmetricMatrix
108 | UniformVector::CovarianceGet() const
109 | {
110 | SymmetricMatrix sigma(3);
111 | sigma = 0;
112 | for (unsigned int i = 0; i < 3; i++)
113 | sigma(i + 1, i + 1) = pow(size_[i], 2);
114 | return sigma;
115 | }
116 |
117 | } // End namespace BFL
118 |
--------------------------------------------------------------------------------
/leg_detector/include/leg_detector/laser_processor.h:
--------------------------------------------------------------------------------
1 | /*********************************************************************
2 | * Software License Agreement (BSD License)
3 | *
4 | * Copyright (c) 2008, Willow Garage, Inc.
5 | * All rights reserved.
6 | *
7 | * Redistribution and use in source and binary forms, with or without
8 | * modification, are permitted provided that the following conditions
9 | * are met:
10 | *
11 | * * Redistributions of source code must retain the above copyright
12 | * notice, this list of conditions and the following disclaimer.
13 | * * Redistributions in binary form must reproduce the above
14 | * copyright notice, this list of conditions and the following
15 | * disclaimer in the documentation and/or other materials provided
16 | * with the distribution.
17 | * * Neither the name of the Willow Garage nor the names of its
18 | * contributors may be used to endorse or promote products derived
19 | * from this software without specific prior written permission.
20 | *
21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 | * POSSIBILITY OF SUCH DAMAGE.
33 | *********************************************************************/
34 |
35 | #ifndef LEG_DETECTOR_LASER_PROCESSOR_H
36 | #define LEG_DETECTOR_LASER_PROCESSOR_H
37 |
38 | #include
39 | #include
40 | #include
41 | #include
42 | #include
43 |
44 | #include
45 | #include
46 | #include
47 | #include