Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added images for bases. Updated README.

  • Loading branch information...
commit b461653962f7c9b98f3871d0f0d09190dfe66569 1 parent f17554e
@oscillare oscillare authored
View
BIN  ihe_hardware/turtlebot_xtion_top_description/images/turtlebot_xtension.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  ihe_hardware/turtlebot_xtion_top_description/images/turtlebot_xtion.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
1  ihe_hardware/turtlebot_xtion_top_description/manifest.xml
@@ -14,6 +14,7 @@
<depend package="pluginlib"/>
<export>
+ <urdf base="${prefix}/urdf/turtlebot_xtion.uraf"/>
<urdf plugin="${prefix}/urdf/xtion.uraf"/>
</export>
</package>
View
6 ihe_hardware/turtlebot_xtion_top_description/urdf/turtlebot_xtion.uraf
@@ -0,0 +1,6 @@
+-
+ file: urdf/turtlebot.urdf.xacro
+ image: images/turtlebot_xtion.png
+-
+ file: urdf/turtlebot_x45_xtended.urdf.xacro
+ image: images/turtlebot_xtension.png
View
95 ihe_hardware/urdf_compose/README
@@ -1,95 +0,0 @@
-Format for File to be Processed by compose.py (yaml)
-----------------------------------------------------
-
-- package: <package name>
- files:
- - filename: <filename>
- parts:
- - part_name: <macro name>
- params:
- <parameter name>: <parameter value>
-
-
-Generate urdf File
-------------------
-
-Generate xml file.
-
- rosrun urdf_compose compose.py <yaml> [-o <outfile>] [-n <robot name>]
-
-If -o is not specificed, the default is standard output. If -n is not
-specified, the default is "turtlebot".
-
-This script is to be used only if all parts listed are macros.
-
-
-Run Demo
---------
-
-1. Open the urdf directory.
-
- roscd urdf_compose/urdf
-
-2. Generate urdf files. (yaml files are located in the demo directory.)
-
- rosrun urdf_compose compose.py ../demo/kinect.yaml -o kinect.urdf.xacro -n kinect
- rosrun urdf_compose compose.py ../demo/xtion.yaml -o xtion.urdf.xacro -n xtion
- rosrun urdf_compose compose.py ../demo/turtlebot_body.yaml -o turtlebot_body.urdf.xacro
- rosrun urdf_compose compose.py ../demo/turtlebot.yaml -o turtlebot.urdf.xacro
-
-3. Launch rviz.
-
- roslaunch urdf_compose demo.launch model:=<model>
-
- <model> = { kinect.urdf.xacro,
- xtion.urdf.xacro,
- turtlebot.urdf.xacro,
- turtlebot_body.urdf.xacro }
-
-Note: The turtlebot_body included in the package does not include the kinect
- standoffs like the body included in turtlebot_description.
-
-
-
-
-Run GUI
--------
-
-1. Build the turtlebot_body.
-
- roscd urdf_compose/urdf
- rosrun urdf_compose compose.py ../demo/turtlebot_body.yaml -o turtlebot_body.urdf.xacro
-
-2. Run the GUI.
-
- rosrun urdf_compose gui.py
-
-Robots added to the "Select robot" combo box should not be macros. Only unique
-robot names will be listed.
-
-Only macros from added files will be displayed in the "Accessories" list.
-
-You can view your robot with the attached accessories by clicking on the
-"Launch rviz" button. To reactivate the GUI window after launching rviz, close
-the opened rviz window and press Ctrl+C in the terminal where the GUI is
-running.
-
-
-Format for Descripiton Files (yaml)
------------------------------------
-
-<accessory name/macro name>:
- image: <path to image>
- description: <description>
- parent:
- <link name>:
- <position name>:
- params: # parameters for the accessory being described
- <parameter name>: <value>
- requires:
- <path to file that contains the required accessory>
- - <accessory name/macro name>
- <parameter name>: <value> # parameters for required piece
-
-Examples are located in <path to urdf_compose>/urdf/info_kinect.yaml and
-<path to turtlebot_xtion_top_description>/urdf/info_xtion.yaml
View
114 ihe_hardware/urdf_compose/README.md
@@ -0,0 +1,114 @@
+Run GUI
+-------
+
+1. Build the turtlebot_body.
+
+ roscd urdf_compose/urdf
+ rosrun urdf_compose compose.py ../demo/turtlebot_body.yaml -o turtlebot_body.urdf.xacro
+
+2. Run the GUI.
+
+ rosrun urdf_compose gui.py
+
+Only macros from added files will be displayed in the "Accessories" list.
+
+You can view your robot with the attached accessories by clicking on the
+"Launch rviz" button. To reactivate the GUI window after launching rviz, close
+the opened rviz window and press Ctrl+C in the terminal where the GUI is
+running.
+
+
+Adding Your URDFs to the Compositor Automatically
+-------------------------------------------------
+
+In your manifest.xml, add the following export statement:
+
+ <export>
+ <urdf base="${prefix}/PATH/TO/FILE"/>
+ <urdf plugin="${prefix}/PATH/TO/FILE"/>
+ </export>
+
+The base attribute is used for your robot base, i.e., the file is a complete
+URDF (verify by running the check_urdf script in the urdf package). The
+plugin attribute is used for accessories that are to be added onto the base,
+i.e., the file contains macros.
+
+Format for Descripiton Files (uraf)
+-----------------------------------
+
+# Bases
+
+ -
+ file: <path to urdf file>
+ image: <path to image file>
+
+# Plugins (Accessories)
+
+ urdf: <path to urdf file> # this line only appears once per file
+ <accessory name/macro name>:
+ image: <path to image>
+ description: <description>
+ parent:
+ <link name>:
+ <position name>:
+ params: # parameters for the accessory being described
+ <parameter name>: <value>
+ requires:
+ <path to file that contains the required accessory>
+ - <accessory name/macro name>
+ <parameter name>: <value> # parameters for required piece
+
+Examples are located in $(find urdf_compose)/urdf/kinect.uraf and
+$(find turtlebot_xtion_top_description)/urdf/xtion.uraf
+
+
+Format for File to be Processed by compose.py (yaml)
+----------------------------------------------------
+
+ - package: <package name>
+ files:
+ - filename: <filename>
+ parts:
+ - part_name: <macro name>
+ params:
+ <parameter name>: <parameter value>
+
+
+Generate urdf File (compose.py)
+-------------------------------
+
+To generate an XML file, run:
+
+ rosrun urdf_compose compose.py <yaml> [-o <outfile>] [-n <robot name>]
+
+If -o is not specificed, the default is standard output. If -n is not
+specified, the default is "turtlebot".
+
+This script is to be used only if all parts listed are macros.
+
+
+Run Demo (compose.py)
+---------------------
+
+1. Open the urdf directory.
+
+ roscd urdf_compose/urdf
+
+2. Generate urdf files. (yaml files are located in the demo directory.)
+
+ rosrun urdf_compose compose.py ../demo/kinect.yaml -o kinect.urdf.xacro -n kinect
+ rosrun urdf_compose compose.py ../demo/xtion.yaml -o xtion.urdf.xacro -n xtion
+ rosrun urdf_compose compose.py ../demo/turtlebot_body.yaml -o turtlebot_body.urdf.xacro
+ rosrun urdf_compose compose.py ../demo/turtlebot.yaml -o turtlebot.urdf.xacro
+
+3. Launch rviz.
+
+ roslaunch urdf_compose demo.launch model:=<model>
+
+ <model> = { kinect.urdf.xacro,
+ xtion.urdf.xacro,
+ turtlebot.urdf.xacro,
+ turtlebot_body.urdf.xacro }
+
+Note: The turtlebot_body included in the package does not include the kinect
+ standoffs like the body included in turtlebot_description.
View
28 ihe_hardware/urdf_compose/src/gui/gui.py
@@ -142,19 +142,21 @@ def initComboBoxes(self):
data = data.getElementsByTagName("robot")[0]
robotKey = data.getAttribute("name")
- robotKey += " (%s : %s)" % (result[i],
- os.path.basename(fpath))
- self.robots[robotKey] = {'file':path,
- 'image':find + "/" + robot['image']}
+ robotKey += " (%s : %s)" % (result[i], os.path.basename(fpath))
+ image = robot['image']
+
+ if image:
+ image = find + "/" + image
+
+ self.robots[robotKey] = {'file':path, 'image':image}
else:
with open(result[i+1], 'r') as f:
data = parse(f)
data = data.getElementsByTagName("robot")[0]
robotKey = data.getAttribute("name")
- robotKey += " (%s : %s)" % (result[i],
- os.path.basename(result[i+1]))
- self.robots[robotKey] = {'file':getResolveString(result[i+1]),
+ robotKey += " (%s : %s)" % (result[i], os.path.basename(result[i+1]))
+ self.robots[robotKey] = {'file' :getResolveString(result[i+1]),
'image':''}
i += 2
@@ -276,9 +278,11 @@ def addRobot(self):
def addRobotToComboBox(self, robotName, robotInfo):
# if robot exists already
- if self.cb_robots.findText(robotName, QtCore.Qt.MatchExactly) == 1:
- msg = self.tr("Robot \"%s\" already exists.\n\n"
- "Replace the existing \"%s\"?") % (robotName, robotName)
+ if self.cb_robots.findText(robotName, QtCore.Qt.MatchExactly) > -1:
+ name, pkg, fname, _ = re.split(r"[ ():]*", robotName)
+ msg = self.tr("Robot \"%s\" from package %s and file %s "
+ "already exists.\n\n"
+ "Do you wish to replace the robot?") % (name, pkg, fname)
reply = QtGui.QMessageBox.question(self, "Add Robot", msg,
QtGui.QMessageBox.Yes,
QtGui.QMessageBox.No)
@@ -387,7 +391,7 @@ def addAccToRobot(self, result, pkg, fname, fpath=""):
self.dialog.close()
- accInfo = result['part_name'] + " (" + pkg + ":" + fname + ")"
+ accInfo = "%s (%s:%s)" % (result['part_name'], pkg, fname)
for k, v in result['params'].items():
accInfo += ("\n " + k + ": " + v)
@@ -501,7 +505,7 @@ def createFile(self, path):
child = child.nextSibling
for acc in self.attachedAccessories:
- key = acc[1] + " (" + acc[0] + ")" # fname (pkg)
+ key = "%s (%s)" % (acc[1], acc[0]) # fname (pkg)
try:
fpath = self.files[key]['file']
View
4 ihe_hardware/urdf_compose/src/gui/guiAccessoryPopups.py
@@ -219,7 +219,7 @@ def addCB(self):
added = self.parent.addAccToRobot(result, self.pkg, self.fname)
if added:
- accInfo = result['part_name'] + " (" + self.pkg + ":" + self.fname + ")"
+ accInfo = "%s (%s : %s)" % (result['part_name'], self.pkg, self.fname)
for k, v in result['params'].items():
accInfo += ("\n " + k + ": " + v)
@@ -236,7 +236,7 @@ def addCB(self):
added = self.parent.addAccToRobot(result, pkg, fname, fpath)
if added:
- accInfo = result['part_name'] + " (" + pkg + ":" + fname + ")"
+ accInfo = "%s (%s : %s)" % (result['part_name'], pkg, fname)
for k, v in result['params'].items():
accInfo += ("\n " + k + ": " + v)
Please sign in to comment.
Something went wrong with that request. Please try again.