New URCap in Windows (Maven in Intellij)

I’m new to URCap Development and Maven. I’m trying to develop URCaps from my native Windows OS to run on a VM Polyscope. I successfully resolved dependency and plugin issues I encountered when importing the helloworld project into Intellij, but without being able to run any of the helper scripts like newURCap.sh, I’m lost in trying to create a new project. Is anyone else developing from Windows or Intellij? Or might be able to help?

Hi,
I think you can’t, Windows is just not supported.

But what you can do is having a VM, with the sdk inside, and a shared folder. Then open the project from the shared folder from you IDE in windows, and when you’re ready to test, you build it/launch it from the VM.
You’ll also have to create the new urcap from the VM.

Tips:
I personally made a script that copy my project to the proper location before building it, and after the build to the /programs of the virtual robot. Then a script move my VM cursor to load the urcap and restart Polyscope (and then, do some stuff i’m testing).

Hi @mdi,

I meant to respond to you sooner, we got it to work! Because the URCap is really just a .jar file which is cross-platform, you can build the project on whatever platform. Deploying it to the VM was a little difficult, but not too bad. You just have to change the linux commands in the pom.xml file to corresponding Windows putty commands and change the VM network adapter to a bridged adapter. I was also able to do the same to deploy to the physical robot too. No need for extra scripts, shared folders or other workarounds! If anyone would like to do this, I can help.

3 Likes

Grantd,
I am very interested in how you accomplished building the URCap in windows and then deploying it to the virtual machine. I would appreciate your guidance.
Jerry Stokely

@jerry.stokely,
It’s been a little while since I set it up, so I don’t remember all of the details, but here’s what I got.

1: Make sure your virtual machine network adapter is set up as a Bridged Adapter. I’m using VirtualBox, and these settings can be found under Settings>>Network. In the virtual machine, if you run ifconfig you should see that the IP Address of the virtual machine is now on the same sub net as the host Windows machine.

2: To install the URCap SDK, I copied the three files under …\URCapSDK\artifacts\api\1.1.x (whichever version you want to use) to C:\Users\grant.m2\repository\com\ur\urcap\api\1.0.0.30. I’m a bit fuzzy on why this was the location because I did this a while ago but I’m pretty sure that this was the location that IntelliJ was complaining that it couldn’t find the dependencies specified in the POM.

3: If you do not have it installed, install PuTTY. It can be found here. You’ll need to use the command lines that come with PuTTY. When I first tried, the commands were not found but I easily fixed this by reinstalling the latest version.

4: There are a bunch of changes that need to be changed in the pom.xml file to get this to work. Because the virtual machine is on the same sub net as the host, deploying to the vm is really no different than deploying to a remote machine running URSim. This means that you can almost use ursim profile except that this profile uses Linux commands that fail. Basically, I just tried to run it and whenever I got an execution error, I would find the Linux command that failed and replace it with the corresponding PuTTY command.

I created a new profile I called ursimvm by copying ursim and making the necessary changes. Mine looks like this:

<profile>
        <id>ursimvm</id>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>exec-maven-plugin</artifactId>
                    <version>1.1</version>
                    <executions>
                        <execution>
                            <id>ursimvm-install-urcap</id>
                            <phase>install</phase>
                            <goals>
                                <goal>exec</goal>
                            </goals>
                            <configuration>
                                <executable>pscp</executable>
                                <commandlineArgs>-pw ${ursimvm.install.password} target\\${project.build.finalName}.jar ${ursimvm.install.username}@${ursimvm.install.host}:/home/ur/ursim-current/.urcaps/${urcap.symbolicname}.jar</commandlineArgs>
                                <workingDirectory>.</workingDirectory>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </profile>

Basically the only change is changing a Linux cp command to a PuTTY pscp command to copy the .jar file to the remote machine. You also need to change the IP Address here:

<!--Host and standard user/password for UR Sim running in a VM-->
<ursimvm.install.host>XXX.XXX.XXX.XXX</ursimvm.install.host>
<ursimvm.install.username>ur</ursimvm.install.username>
<ursimvm.install.password>easybot</ursimvm.install.password>

This IP Address needs to match the IP Address of the vm. From there, you should be able to run mvn install -P ursimvm and restart URSim to install your URCap.

I hope this helps and I didn’t miss any steps.

3 Likes

Thank you for the information. I might just be in a bit over my head but I will give it a try and let you know how it goes.
Thanks again for the assist.
Jerry

@grantd
Thanks for this thread. I understand how you could deploy to a vm (or robot) from a Windows PC.
Could you give a bit more info on how to get the compilation itself working? Did you have a cpp daemon in your project? How can that work from windows? Do we need to install urtool3 cross compiler somehow?

I know it’s been a while, but any information would be appreciated.

Thanks!