Swarm robotics in ROS-Gazebo. Facing very odd errors.

asked 2020-06-24 23:29:04 -0500

aniruddhkb gravatar image

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_r... . Before describing my issue, I will attempt to describe my code.

This is on Ubuntu 18.04/Melodic/Gazebo-9/Python2.7

a) chuha_robot_description contains the URDF, meshes and the controllers (velocity_controllers/VelocityJointController from ROS_control). An instance is spawned with the controller configured using chuha_robot_description/launch/gazebo_basic_spawn.launch

b) chuha_state_repeater contains a script to listen to gazebo/modelStates and transmit the x, y, theta for each Chuha robot on its own topic

c) chuha_alt_cartesian_control allows you to specify an (x, y) that you wish the robot to go to.

d) swarm_particle_swarm_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 chuha_alt_cartesian_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?

edit retag flag offensive close merge delete