code is getting stuck while getting model state from gazebo
I am running a reinforcement learning-based model using ros and gazebo. My total number of episodes are 10,000. But around 50 to 100th episodes, I am not able to get the position of my robot.
client = rospy.ServiceProxy('/gazebo/get_model_state', GetModelState)
model_state = client('model_name','world')
I am running in windows subsystem (Ubuntu) Ros Melodic Gazebo 9x
It got stuck and not proceeding further. Kindly help me in this regard.
Have you tried this in a native enviroment? Furthermore, what info do you want from the model state? You may want to obtain that from a topic instead of requesting a service every new cycle.
I just took a AWS Ubuntu instance and it seems to work without any hassle, but in WSL 1 it gets stuck
I am getting the orientation and the position of the robot from the model state
Well, you can try to get that information by subscribing to the model odometry and test if it is a problem of the several service calls or the enviroment performace. I have never tried to work over WSL since it is tagged as an experimental platform, that may be the reason why there are certain things that do not work as intended.
Yes Weasfas, you are correct, even subscribing to the model odometry also fails at some point of time, I have spun a ubuntu machine and it works like a charm.