Functions | Variables
spawn_object Namespace Reference

Functions

def get_flat_dict (objects, parent_name)
 

Variables

dictionary compound_keys = {}
 
 existing_models = world_properties.model_names
 
 f = os.popen("xacro "+ xacro_args + " " + file_location)
 
string file_location = roslib.packages.get_pkg_dir(model_package) + "/" + model_path
 
def flat_objects = get_flat_dict(objects,None)
 
 found_groups = set(groups.keys()) & set(sys.argv)
 
 groups = rospy.get_param("/object_groups")
 
 initial_pose
 
 model_name
 
 model_package = model_string.split("/")[0]
 
 model_path = model_string.replace(model_package + "/", "")
 
 model_string = value["model"]
 
 model_type = model_string.split(".").pop()
 
 model_xml
 
list object_names = [groups[k] for k in found_groups]
 
 object_pose = Pose()
 
 objects = rospy.get_param("/objects")
 
 orientation = value["orientation"]
 
dictionary parents = {}
 
 position = value["position"]
 
 quaternion = tft.quaternion_from_euler(orientation[0], orientation[1], orientation[2])
 
 req = SpawnModelRequest()
 
 res = srv_delete_model(key)
 
 srv_delete_model = rospy.ServiceProxy('gazebo/delete_model', DeleteModel)
 
 srv_get_world_properties = rospy.ServiceProxy('/gazebo/get_world_properties', GetWorldProperties)
 
 srv_spawn_model = rospy.ServiceProxy('/gazebo/spawn_'+model_type+'_model', SpawnModel)
 
 w
 
 world_properties = srv_get_world_properties()
 
 x
 
string xacro_args = '--inorder' if (os.environ['ROS_DISTRO'] < 'melodic') else ''
 
 xml_string = f.read()
 
 y
 
 z
 

Function Documentation

◆ get_flat_dict()

def spawn_object.get_flat_dict (   objects,
  parent_name 
)
expands all objects to a flat dictionary

Definition at line 33 of file spawn_object.py.

Variable Documentation

◆ compound_keys

dictionary spawn_object.compound_keys = {}

Definition at line 31 of file spawn_object.py.

◆ existing_models

list spawn_object.existing_models = world_properties.model_names

Definition at line 136 of file spawn_object.py.

◆ f

spawn_object.f = os.popen("xacro "+ xacro_args + " " + file_location)

Definition at line 186 of file spawn_object.py.

◆ file_location

string spawn_object.file_location = roslib.packages.get_pkg_dir(model_package) + "/" + model_path

Definition at line 177 of file spawn_object.py.

◆ flat_objects

def spawn_object.flat_objects = get_flat_dict(objects,None)

Definition at line 88 of file spawn_object.py.

◆ found_groups

spawn_object.found_groups = set(groups.keys()) & set(sys.argv)

Definition at line 102 of file spawn_object.py.

◆ groups

dictionary spawn_object.groups = rospy.get_param("/object_groups")

Definition at line 92 of file spawn_object.py.

◆ initial_pose

spawn_object.initial_pose

Definition at line 226 of file spawn_object.py.

◆ model_name

spawn_object.model_name

Definition at line 224 of file spawn_object.py.

◆ model_package

spawn_object.model_package = model_string.split("/")[0]

Definition at line 147 of file spawn_object.py.

◆ model_path

spawn_object.model_path = model_string.replace(model_package + "/", "")

Definition at line 148 of file spawn_object.py.

◆ model_string

spawn_object.model_string = value["model"]

Definition at line 146 of file spawn_object.py.

◆ model_type

string spawn_object.model_type = model_string.split(".").pop()

Definition at line 149 of file spawn_object.py.

◆ model_xml

spawn_object.model_xml

Definition at line 225 of file spawn_object.py.

◆ object_names

list spawn_object.object_names = [groups[k] for k in found_groups]

Definition at line 104 of file spawn_object.py.

◆ object_pose

spawn_object.object_pose = Pose()

Definition at line 166 of file spawn_object.py.

◆ objects

dictionary spawn_object.objects = rospy.get_param("/objects")

Definition at line 87 of file spawn_object.py.

◆ orientation

spawn_object.orientation = value["orientation"]

Definition at line 162 of file spawn_object.py.

◆ parents

dictionary spawn_object.parents = {}

Definition at line 30 of file spawn_object.py.

◆ position

spawn_object.position = value["position"]

Definition at line 155 of file spawn_object.py.

◆ quaternion

spawn_object.quaternion = tft.quaternion_from_euler(orientation[0], orientation[1], orientation[2])

Definition at line 163 of file spawn_object.py.

◆ req

spawn_object.req = SpawnModelRequest()

Definition at line 223 of file spawn_object.py.

◆ res

spawn_object.res = srv_delete_model(key)

Definition at line 217 of file spawn_object.py.

◆ srv_delete_model

spawn_object.srv_delete_model = rospy.ServiceProxy('gazebo/delete_model', DeleteModel)

Definition at line 215 of file spawn_object.py.

◆ srv_get_world_properties

spawn_object.srv_get_world_properties = rospy.ServiceProxy('/gazebo/get_world_properties', GetWorldProperties)

Definition at line 128 of file spawn_object.py.

◆ srv_spawn_model

spawn_object.srv_spawn_model = rospy.ServiceProxy('/gazebo/spawn_'+model_type+'_model', SpawnModel)

Definition at line 211 of file spawn_object.py.

◆ w

spawn_object.w

Definition at line 173 of file spawn_object.py.

◆ world_properties

spawn_object.world_properties = srv_get_world_properties()

Definition at line 131 of file spawn_object.py.

◆ x

spawn_object.x

Definition at line 167 of file spawn_object.py.

◆ xacro_args

string spawn_object.xacro_args = '--inorder' if (os.environ['ROS_DISTRO'] < 'melodic') else ''

Definition at line 185 of file spawn_object.py.

◆ xml_string

spawn_object.xml_string = f.read()

Definition at line 202 of file spawn_object.py.

◆ y

spawn_object.y

Definition at line 168 of file spawn_object.py.

◆ z

spawn_object.z

Definition at line 169 of file spawn_object.py.



cob_gazebo_tools
Author(s): Felix Messmer , Nadia Hammoudeh Garcia , Florian Weisshardt
autogenerated on Wed Feb 21 2024 03:23:00