Swarm robotics in ROS-Gazebo. Facing very odd errors.
I am attempting to simulate 8 instances of a simple differential-drive robot using ROS-Gazebo. My codebase is at https://github.com/aniruddhkb/swarm_robotics/tree/debugging/src . Before describing my issue, I will attempt to describe my code.
This is on Ubuntu 18.04/Melodic/Gazebo-9/Python2.7
a) chuharobotdescription contains the URDF, meshes and the controllers (velocitycontrollers/VelocityJointController from ROScontrol). An instance is spawned with the controller configured using chuharobotdescription/launch/gazebobasicspawn.launch
b) chuhastaterepeater contains a script to listen to gazebo/modelStates and transmit the x, y, theta for each Chuha robot on its own topic
c) chuhaaltcartesian_control allows you to specify an (x, y) that you wish the robot to go to.
d) swarmparticleswarm_optimization is for the PSO algorithm. There is fitness.py which publishes the fitness for each robot, and pso.py which publishes the desired (x,y) at each timestep for each robot.
Now, I can describe the problem.
When I run 2 or fewer robot instances with the setup described above, the robots perform as expected -- the robots tend to converge to the point where the current best fitness is found.
However, when 3 or more robots are spawned, very erratic and unexpected behaviour ensues. The problem is not at pso.py or fitness.py .
Given a particular (x, y) that the robots are supposed to go to, instead of going there, the robots simply spin in one place and take tiny steps erratically and not towards the desired point. Quite simply, the chuhaaltcartesian_control module is catastrophically failing.
I have tried everything I can think of, including recording data from the robot in a CSV and checking the decision-making processes manually.
A key point I think is that in the cases where the robot succeeds, the real time factor is .99, whereas it is a little bit lower for 3 robots and much lower for 8 robots.
Can someone help me out?
Asked by aniruddhkb on 2020-06-24 23:29:04 UTC
Comments