diff --git a/swarm_robot_simulation/src/two_wheel_robot_aggregation.cpp b/swarm_robot_simulation/src/two_wheel_robot_aggregation.cpp index 6a4598a..43976c2 100644 --- a/swarm_robot_simulation/src/two_wheel_robot_aggregation.cpp +++ b/swarm_robot_simulation/src/two_wheel_robot_aggregation.cpp @@ -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" diff --git a/swarm_robot_simulation/src/two_wheel_robot_dispersion.cpp b/swarm_robot_simulation/src/two_wheel_robot_dispersion.cpp index 5e57d7c..d0468a0 100644 --- a/swarm_robot_simulation/src/two_wheel_robot_dispersion.cpp +++ b/swarm_robot_simulation/src/two_wheel_robot_dispersion.cpp @@ -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" diff --git a/swarm_robot_simulation/src/two_wheel_robot_line_formation.cpp b/swarm_robot_simulation/src/two_wheel_robot_line_formation.cpp index 61eb0c3..e1a239f 100644 --- a/swarm_robot_simulation/src/two_wheel_robot_line_formation.cpp +++ b/swarm_robot_simulation/src/two_wheel_robot_line_formation.cpp @@ -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"