ImportError: cannot import name 'ModelStates' from 'gazebo_msgs.msg' (unknown location)
Hi, I'm using Ros Noetic and Gazebo 11.11 and I'm trying to adapt the youbotdescription package on it. I've already created package.xml, wrote the CMakeList and I've correct all the issues about the files contained in the package. Now, when I try to launch my youbotpublisher.launch, I've the error in the title; the error is in spawn_model file:
import rospy import sys import os import argparse import xml try: # Python 3.x from urllib.parse import urlsplit, SplitResult except ImportError: # Python 2.x from urlparse import urlsplit, SplitResult from gazeboros import gazebointerface from gazebomsgs.msg import ModelStates from gazebomsgs.srv import DeleteModel from stdsrvs.srv import Empty from geometrymsgs.msg import Pose, Quaternion from tf.transformations import quaternionfromeuler
When I launch, I receive the error:
Traceback (most recent call last):
File "/opt/ros/noetic/lib/gazeboros/spawnmodel", line 30, in
It can import everything except gazebomsgs, I tried already to execute the example about the Coke Can and i receive the same error, I've tried to add gazeboros and gazebo_msgs in my package and in my CMakeList, what can I do? Thanks to everyone.
Asked by whazzv on 2023-05-17 17:16:49 UTC
Comments