I am trying to do a simple example for learning Gazebo simulation.
But while I am launching the launch file I am facing the problem which I attached as a photo.
Also, I added the codes I used as a launch file and as a world file.
<!-- empty_world.launch file -->
<?xml version="1.0" encoding="utf-8"?>
<launch>
<!-- overwrite these args -->
<arg name="debug" default="false"/>
<arg name="gui" default="false"/>
<arg name="pause" default="true"/>
<arg name="world" default="$(find my_simulations)/worlds/empty_world.world"/>
<!--include gazeboo_ros launcher-->
<include file="$(find gazebo_ros)/launch/empty_world.launch">
<args name="world_name" value="$(arg_world)"/>
<arg name="debug" value="$(arg_debug)"/>
<arg name="gui" value="$(arg_gui)"/>
<arg name="paused" value="$(arg_pause)"/>
<arg name="use_sim_time" value="true"/>
</include>
</launch>
<!-- empty_world.world file -->
<?xml version="1.0" ?>
<sdf version="1.5">
<world name="default">
<!-- A global light source -->
<include>
<uri>model://sun</uri>
</include>
<!-- A ground plane -->
<include>
<uri>model://ground_plane</uri>
</include>
</world>
</sdf>
$(arg_world) , $(arg_debug) ,$(arg_pause) and $(arg_gui) has typing error. remove _ and it would be fine
Related
When I edit my ant file, eclipse doesn't execute the ant correctly (does nothing). The file was auto generated from exporting a runnable jar file and I edited it afterwards. Here the ant file:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project default="create_run_jar" name="Create Runnable Jar for Project Elevox">
<!--this file was created by Eclipse Runnable JAR Export Wizard-->
<!--ANT 1.7 is required -->
<!--define folder properties-->
<property name="dir.buildfile" value="."/>
<property name="dir.workspace" value="${dir.buildfile}/.."/>
<property name="dir.jarfile" value="C:/Users/faust/Desktop/Elevox"/>
<property name="dir.target" value="C:/Users/faust/Desktop/Elevox/elevox"/>
<target name="create_run_jar">
<copydir src="${dir.buildfile}/image" dest="${dir.target}/image"/>
<copydir src="${dir.buildfile}/models" dest="${dir.target}/models"/>
<copydir src="${dir.buildfile}/music" dest="${dir.target}/music"/>
<copydir src="${dir.buildfile}/shader" dest="${dir.target}/shader"/>
<jar destfile="${dir.jarfile}/Elevox.jar" filesetmanifest="mergewithoutmain">
<manifest>
<attribute name="Main-Class" value="main.Elevox"/>
<attribute name="Class-Path" value="."/>
</manifest>
<fileset dir="${dir.buildfile}/bin"/>
<zipfileset excludes="META-INF/*.SF" src="${dir.buildfile}/lib/disruptor.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${dir.buildfile}/lib/jogg-0.0.7.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${dir.buildfile}/lib/jorbis-0.0.15.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${dir.buildfile}/lib/lwjgl_util.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${dir.buildfile}/lib/lwjgl.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${dir.buildfile}/lib/PNGDecoder.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${dir.buildfile}/lib/slick-util.jar"/>
</jar>
<exec executable="cmd">
<arg value="/c"/>
<arg value="${dir.buildfile}/bundle.bat"/>
<arg value="-p"/>
</exec>
</target>
</project>
Did I make a mistake?
I solved it. It was a classpath error of a specific jar file, which was not well added to the classpath (path contained %20). After deleting it from the classpath and adding it manually again it worked.
The build script I am using:
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="sass">
<target name="sass">
<apply dest="./sass" executable="sassy.bat">
<srcfile />
<targetfile />
<mapper from="*.scss" to="*.css" type="glob"/>
<fileset dir="./sass" includes="**/*.scss" />
</apply>
</target>
</project>
And it works great, with the condition that I have this external sassy.bat script on my %%PATH%%.
sass %1 %2
It compiles sass/*.scss files and puts the *.css in the same directory. However, if I don't use my sassy.bat and rather just use sass.bat it produces:
ruby.exe: Is a directory -- C:/project/sass (LoadError)
But in theory it should be running the same thing. Any idea what I'm doing wrong?
I ended up solving this problem recently. The first step is to ensure that the builder is set to use a "Separate JRE" (Zend Studio's). The second step was to update my buildfile to the following:
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="sass">
<target name="sass">
<exec osfamily="windows" vmlauncher="false" executable="sass">
<arg value="--update" />
<arg value="scss/:css/" />
<arg value="--style=compressed" />
</exec>
</target>
</project>
The key was to set the vmlauncher attribute to false on Windows.
I want to run this working line of code in ant-script:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild ARCHS="armv7 armv7s" ONLY_ACTIVE_ARCH=NO -workspace \APPNAME.xcworkspace -scheme APPNAMETarget build
So far I have this:
<?xml version="1.0" encoding="utf-8"?>
<project name="APPNAME" default="debugbuild" basedir=".">
<target name="debugbuild">
<echo message="Building debug build of APPNAME" />
<exec executable="/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild" os="Mac OS X">
<arg value="-workspace"/>
<arg value="APPNAME.xcworkspace"/>
<arg value="-scheme"/>
<arg value="APPNAMETarget"/>
<arg value="build"/>
</exec>
</target>
</project>
But I also need to add Build Settings (ARCHS="armv7 armv7s" ONLY_ACTIVE_ARCH=NO) but don't know how to add them in the script. I tried
<env key="ONLY_ACTIVE_ARCH" value="NO"/>
But it didn't work.
I found a solution. I just had to add them as arguments like the other but I had to get rid of the parenthesis which were fine in the command line. I hope it is helpful for other because I spend some time on this:
<?xml version="1.0" encoding="utf-8"?>
<project name="APPNAME" default="debugbuild" basedir=".">
<target name="debugbuild">
<echo message="Building debug build of APPNAME" />
<exec executable="/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild" os="Mac OS X">
<arg value="-workspace"/>
<arg value="APPNAME.xcworkspace"/>
<arg value="-scheme"/>
<arg value="APPNAMETarget"/>
<arg value="build"/>
<arg value="ARCHS=armv7 armv7s"/>
<arg value="ONLY_ACTIVE_ARCH=NO"/>
</exec>
</target>
</project>
I'm trying to make an Eclipse-compilable GWT project also compilable on the command line (via Ant).
Eclipse provides functionality to export a build.xml; this works fine for compiling the classes, but since GWT's special stuff is all provided via a plugin, these rules are not included.
Google provides a tool for creating build.xml files for new projects. I've incorporated the rules generated by this into the Eclipse-exported file.
Compiling (the part provided by Eclipse) is successful.
Here is the compile-things-to-javascript task:
<target name="gwtc" depends="build" description="GWT compile to JavaScript (production mode)">
<java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler">
<classpath>
<pathelement location="war/WEB-INF/classes"/>
<pathelement location="src"/>
<path refid="project.class.path"/>
<pathelement location="/Applications/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.4.0.v201201120043-rel-r37/gwt-2.4.0/validation-api-1.0.0.GA.jar" />
<pathelement location="/Applications/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.4.0.v201201120043-rel-r37/gwt-2.4.0/validation-api-1.0.0.GA-sources.jar" />
</classpath>
<!-- add jvmarg -Xss16M or similar if you see a StackOverflowError -->
<jvmarg value="-Xmx256M"/>
<!--<arg line="-style PRETTY"/>-->
<arg line="-war"/>
<arg value="war"/>
<!-- Additional arguments like -style PRETTY or -logLevel DEBUG -->
<arg line="${gwt.args}"/>
<arg value="edu.calpoly.csc.scheduler"/>
</java>
</target>
The .gwt.xml file looks like so:
<?xml version="1.0" encoding="UTF-8"?>
<module rename-to='gwtview'>
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User'/>
<!-- Inherit the default GWT style sheet. You can change -->
<!-- the theme of your GWT application by uncommenting -->
<!-- any one of the following lines. -->
<inherits name='com.google.gwt.user.theme.clean.Clean'/>
<!-- <inherits name='com.google.gwt.user.theme.standard.Standard'/> -->
<!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
<!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->
<!-- Other module inherits -->
<!-- Specify the app entry point class. -->
<entry-point class='edu.calpoly.csc.scheduler.view.client.GWTView'/>
<!-- Specify the paths for translatable code -->
<source path='client'/>
<source path='shared'/>
<source path='view'/>
</module>
When trying to run the task, I get this error:
gwtc:
[java] Compiling module edu.calpoly.csc.scheduler
[java] Finding entry point classes
[java] [ERROR] Unable to find type 'edu.calpoly.csc.scheduler.view.client.GWTView'
[java] [ERROR] Hint: Previous compiler errors may have made this type unavailable
[java] [ERROR] Hint: Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source path entries properly
Which seems strange to me, since the class is very much there:
[$]> ls war/WEB-INF/classes/edu/calpoly/csc/scheduler/view/client
GWTView$1.class GWTView$1MyHandler.class GreetingService.class
GWTView$1MyHandler$1.class GWTView.class GreetingServiceAsync.class
Halp?
Are you sure you have sources of your GWT app on classpath? GWT is compiling java sources to js, not *.class files.
Make sure that you have that library/jar and any other SOURCE needed available on the classpath you pass to the GWT Compiler, as it will need to be able to find the Java source inside GWT libs to be able to compile them, unlike the Javac compiler than can compile against libraries using just the provided .class files.
Here is my ant gwtc compile macro. (removed leading <to avoid formatting problems...)
macrodef name="gwtCompileApplication" >
<attribute name="app" />
<attribute name="extraArgs" default="" />
<attribute name="gwtcExtras" default="" />
<sequential>
<java classpathref="gwtCompile.classpath" classname="com.google.gwt.dev.Compiler" fork="true" failonerror="true">
<jvmarg value="-Xmx512M" />
<arg value="-strict" />
<!-- Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors.
<arg value="-logLevel" />
<arg value="DEBUG" />
-->
<!-- request detailed, non-obfuscated JS output
<arg value="-style" />
<arg value="DETAILED" />
-->
<arg value="-localWorkers" />
<arg value="4" />
<arg value="-war" />
<arg value="${war.dir}" />
<arg value="-deploy" />
<arg value="deploy" />
<!-- These two lines have been removed as otherwise it won't work on Mac OS X
<arg value="#{extraArgs}" />
<arg value="#{gwtcExtras}" />
-->
<!-- This can be used to see more details about warnings, but they will be converted to errors and build will fail
<arg value="-strict" />
-->
<arg value="-logLevel" />
<arg value="INFO" />
<arg value="#{app}" />
</java>
</sequential>
</macrodef>
This can be invoked from any target thus:
A target to compile a specific module of mine called 'Admin" where the file Admin.gwt.xml file is inside .ta.Admin. I have a debug and production build type and a .gwt.xml different for each one to speed up compiling for debug (fewer user agents and languages = fewer permutations)
target name="gwtcAdmin" depends="compile, buildtype" description="GWT Compile Admin" >
<gwtCompileApplication app="com.bcntouch.ta.Admin.${build_type}_Admin" extraArgs="${gwtcArgs}" gwtcExtras="${gwtcExtras}"/>
</target>
But the key part if the GWT compile class path I use. Here is the target where I setup my paths:
target name="gwtPath">
<path id="gwt.classpath">
<pathelement location="${gwt.sdk.dir}/gwt-user.jar" />
<pathelement location="${gwt.sdk.dir}/gwt-servlet.jar" />
</path>
<!-- For GWT compile we need a path with source AND the GWT Compiler classes -->
<path id="gwtCompile.classpath">
<path refid="source.classpath" />
<!-- This is put after source, so GWT Compiler it doesn't pick up out of date versions of old css and uibinder
files in classes generated by Eclipse/GWT Plugin -->
<path refid="classpath" />
<path refid="tool.classpath" />
</path>
</target>
I have an eclipse rcp application being developed in eclipse 3.5. I am able to successfully execute pde headless build in ant (from command shell outside eclipse) via the following target entry:
<target name="compile">
<java classname="org.eclipse.equinox.launcher.Main" fork="true" failonerror="true" dir="some-dir">
<arg value="-application" />
<arg value="org.eclipse.ant.core.antRunner" />
<arg value="-buildfile" />
<arg value="${eclipse.location}/plugins/org.eclipse.pde.build_${some-version}/scripts/productBuild/productBuild.xml" />
<arg value="-Dtimestamp=${timestamp}" />
<arg value="-propertyfile" />
<arg value="${some-dir}/ant.properties" />
<classpath>
<pathelement
location="${eclipse.location}/plugins/org.eclipse.equinox.launcher_${some-version}.jar" />
</classpath>
</java>
</target>
But once AspectJ (AJDT) got involved, I modified the target above like so:
<target name="compile">
<java classname="org.eclipse.equinox.launcher.Main" fork="true" failonerror="true" dir="${some-dir}">
<arg value="-application" />
<arg value="org.eclipse.ant.core.antRunner" />
<arg value="-buildfile" />
**<arg value="${eclipse.location}/plugins/org.eclipse.ajdt.pde.build_2.0.2.e35x-release-20101021-0900/scripts/productBuild/productBuild.xml" />**
<arg value="-Dtimestamp=${timestamp}" />
<arg value="-propertyfile" />
<arg value="${some-dir}/ant.properties" />
**<jvmarg value="-Dajdt.pdebuild.home=${eclipse.location}/plugins/org.eclipse.ajdt.pde.build_2.0.2.e35x-release-20101021-0900" />**
<classpath>
<pathelement
location="${eclipse.location}/plugins/org.eclipse.equinox.launcher_${some-version}.jar" />
</classpath>
</java>
</target>
Unfortunately, I am now getting the following error:
c:\eclipse-3.5\plugins\org.eclipse.ajdt.pde.build_2.0.2.e35x-release-20101021-0900\scripts\productBuild\productBuild.xml:8: Cannot find ${ajdt.pdebuild.scripts}/productBuild/allElements.xml imported from c:\eclipse-3.5\plugins\org.eclipse.ajdt.pde.build_2.0.2.e35x-release-20101021-0900\scripts\productBuild\productBuild.xml
does anyone have any idea on how to set the ajdt.pdebuild.scripts value? thank you!!!
See this blog post:
http://contraptionsforprogramming.blogspot.com/2010/03/ajdt-pde-builds-redux.html
You should not be using AJDT-PDE. That is the old way of doing things and is no longer supported. Instead, you should be making changes to your build.properties file:
# required
compilerAdapter=org.eclipse.ajdt.core.ant.AJDT_AjcCompilerAdapter
sourceFileExtensions=*.java, *.aj
# optional
compilerArg=-aspectpath other.jar
Read the blog post for more details.
there are several steps needed to wrangle ajdt-pde headless build to execute in eclipse 3.5:
1) add ajdt.pdebuild.scripts param with its respective value as a "jvmarg" to the above-shown "java" block.
2) in .../scripts/productBuild/productBuild.xml, change property name="allElementsFile" value="productBuild/allElements.xml" to this property name="allElementsFile" value="${ajdt.pdebuild.scripts}/productBuild/allElements.xml"
3) in .../scripts/productBuild/productBuild.xml, comment out import file="${ajdt.pdebuild.scripts}/productBuild/allElements.xml"
4) in .../scripts/productBuild/productBuild.xml, paste the following import statement: import file="${ajdt.pdebuild.scripts}/build.xml"