Problem with Gazebo std::bad_alloc
I installed Gazebo a couple weeks ago along with ros-kinetics on ubuntu 16.04. Until yesterday Gazebo would launch with no problems, I have hardly used it and now when I try to launch it as an application it appears for a split second and then disappears, while if I try to launch it with the terminal it says
"terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
I just installed ubuntu and have never used this kind of stuff so I have no idea of what the problem could be, i tried searching for this problem but most people are having this problem as a C++ problem. Yesterday during class we wrote some C++ code, but I didn't link it to Gazebo. I don't know what to do and I'm afraid I might to some mistake while trying to fix it.
Thank you in advance
Asked by Aestor on 2018-03-20 07:20:26 UTC
Comments
Instead of just using the gazebo command, try doing the following: 1) open a terminal, and run the command "roscore" 2) open another terminal and now run "rosrun gazebo_ros gazebo" Does doing this give you different results?
Asked by Raskkii on 2018-03-20 08:31:18 UTC
I tried it and it says "[rospack] Error: package 'gazebo_ros' not found"
This morning I tried to uninstall and reinstall gazebo with sudo apt-get remove gazebo7 and later sudo apt-get install gazebo7, could that be the problem I am facing right now?
Asked by Aestor on 2018-03-20 08:44:53 UTC
Try running: "sudo apt-get install ros-kinetic-gazebo-ros-pkgs" and after that try the instructions from my first comment again.
Asked by Raskkii on 2018-03-20 09:10:33 UTC
I tried that and now it gives me this: [ INFO] [1521635182.476361394]: Finished loading Gazebo ROS API Plugin. [ INFO] [1521635182.476970063]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting... [ INFO] [1521635182.965983542]: waitForService: Service [/gazebo/set_physics_properties] is now available. [ INFO] [1521635182.991163134]: Physics dynamic reconfigure ready. terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc
Asked by Aestor on 2018-03-21 07:24:31 UTC
Aborted (core dumped) /opt/ros/kinetic/lib/gazebo_ros/gazebo: 46: kill: invalid signal number or name: SIGINT
Asked by Aestor on 2018-03-21 07:25:02 UTC
So it goes back to the std::bad_alloc error. I've encountered it a few times but it's usually resolved when i simply run Gazebo again. From quickly googling, std::bad_alloc is caused when you run out of memory. Unfortunately I'm not sure if I know how to help you resolve this problem.
Asked by Raskkii on 2018-03-21 11:15:29 UTC
Having the same problem here with std::bad_alloc and yes it is due to a memory issue. Still did not find how to solve this. Does anyone have some recommendations here ? thx
Asked by jkoubi on 2022-02-02 17:05:05 UTC