Skip to content

Commit

Permalink
add algorithm explanation for each simulation
Browse files Browse the repository at this point in the history
  • Loading branch information
yangliu28 committed Jun 26, 2016
1 parent d3b65fb commit af6b609
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
7 changes: 6 additions & 1 deletion swarm_robot_simulation/src/two_wheel_robot_aggregation.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
// this node is the aggregation simulation of two wheel robots

// aggregation algorithm:

// This simulation aggregates a swarm of two wheel robots by a geometric center method. Each robot
// calculates the geometric center of all its neighbors in the sensing range. The first feedback vector
// starts from the robot to the geometric center. In order to avoid collision, a spring model with only
// propulsional force (the spring only pushes two robots away, not drag them together) is used for all
// neighbors with distance smaller than spring length. This is the second feedback vector. Then two feedback
// vector will be fused into one with weighted ratio.

// subscribe to topic "/swarm_sim/two_wheel_robot"
// service client to service "/gazebo/set_joint_properties"
Expand Down
8 changes: 7 additions & 1 deletion swarm_robot_simulation/src/two_wheel_robot_dispersion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
// this is the first simulation program written for two wheel robots

// dispersion algorithm explanation:

// This simulation uses the force feedback from a spring model to control the speed and moving direction
// of the robots. The key is to decide which robots will be the neighbors. In the sensing range of one
// robot, all robots of distances within the spring length plus a small portion of spring length are
// qualified. If the number exceed a defined upper limit (6 for example), the closest 6 will be chosen.
// If the number is smaller than a defined lower limit (3 for example), the distance constraint will be
// overrode, and trying to get as much neighbor number as the define lower limit if possible (within
// sensing range). Then calculating the feedback vector based on the spring force.

// subscribe to topic "/swarm_sim/two_wheel_robot"
// service client to service "/gazebo/set_joint_properties"
Expand Down
10 changes: 9 additions & 1 deletion swarm_robot_simulation/src/two_wheel_robot_line_formation.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
// this node is the line formation simulation of two wheel robots

// line formation algirithm explanation:

// This simulation forms a line by using a local line fitting technique. Each robot does a linear fitting
// on all its neighbor robots in the sensing range. Then calculating two feedback vectors to drive the
// robot into its fitted line: perpendicular feedback vector and parallel feedback vector. Perpendicular
// feedback vector starts from the robot to the perpendicular point on the fitted line. Computation of
// parallel feedback vector needs two neighboring robot. These two neighbors locates at the left and right
// of the robot, they have the smallest distance to the perpendicular line. It's OK that the left or
// right robot is missing (or both). Neighbors' distance to the perpendicular will be calculate the parallel
// feedback vector as in the spring model. Then two feedback vector will be fused into one with weighted
// ratio.

// subscribe to topic "/swarm_sim/two_wheel_robot"
// service client to service "/gazebo/set_joint_properties"
Expand Down

0 comments on commit af6b609

Please sign in to comment.