Ejemplo n.º 1
0
        // Beginning method for exporting the full package
        public void exportRobot()
        {
            //Setting up the progress bar

            int progressBarBound = Common.getCount(mRobot.BaseLink);

            progressBar.Start(0, progressBarBound, "Creating package directories");

            //Creating package directories
            URDFPackage package = new URDFPackage(mPackageName, mSavePath);

            package.createDirectories();
            mRobot.name = mPackageName;
            string windowsURDFFileName     = package.WindowsRobotsDirectory + mRobot.name + ".URDF";
            string windowsManifestFileName = package.WindowsPackageDirectory + "manifest.xml";

            //Creating manifest file
            manifestWriter manifestWriter = new manifestWriter(windowsManifestFileName);
            manifest       Manifest       = new manifest(mPackageName);

            Manifest.writeElement(manifestWriter);

            //Creating RVIZ launch file
            Rviz rviz = new Rviz(mPackageName, mRobot.name + ".URDF");

            rviz.writeFiles(package.WindowsLaunchDirectory);

            //Creating Gazebo launch file
            Gazebo gazebo = new Gazebo(this.mRobot.name, this.mPackageName, mRobot.name + ".URDF");

            gazebo.writeFile(package.WindowsLaunchDirectory);


            //Customizing STL preferences to how I want them
            saveUserPreferences();
            setSTLExportPreferences();

            //Saving part as STL mesh
            AssemblyDoc   assyDoc          = (AssemblyDoc)ActiveSWModel;
            List <string> hiddenComponents = Common.findHiddenComponents(assyDoc.GetComponents(false));

            ActiveSWModel.Extension.SelectAll();
            ActiveSWModel.HideComponent2();
            string filename = exportFiles(mRobot.BaseLink, package, 0);

            mRobot.BaseLink.Visual.Geometry.Mesh.filename    = filename;
            mRobot.BaseLink.Collision.Geometry.Mesh.filename = filename;

            Common.showAllComponents(ActiveSWModel, hiddenComponents);
            //Writing URDF to file

            URDFWriter uWriter = new URDFWriter(windowsURDFFileName);

            mRobot.writeURDF(uWriter.writer);

            resetUserPreferences();
            progressBar.End();
        }
Ejemplo n.º 2
0
        // Beginning method for exporting the full package
        public void exportRobot()
        {
            //Setting up the progress bar

            int progressBarBound = Common.getCount(mRobot.BaseLink);
            progressBar.Start(0, progressBarBound, "Creating package directories");

            //Creating package directories
            URDFPackage package = new URDFPackage(mPackageName, mSavePath);
            package.createDirectories();
            mRobot.name = mPackageName;
            string windowsURDFFileName = package.WindowsRobotsDirectory + mRobot.name + ".URDF";
            string windowsManifestFileName = package.WindowsPackageDirectory + "manifest.xml";

            //Creating manifest file
            manifestWriter manifestWriter = new manifestWriter(windowsManifestFileName);
            manifest Manifest = new manifest(mPackageName);
            Manifest.writeElement(manifestWriter);

            //Creating RVIZ launch file
            Rviz rviz = new Rviz(mPackageName, mRobot.name + ".URDF");
            rviz.writeFiles(package.WindowsLaunchDirectory);

            //Creating Gazebo launch file
            Gazebo gazebo = new Gazebo(this.mRobot.name, this.mPackageName, mRobot.name + ".URDF");
            gazebo.writeFile(package.WindowsLaunchDirectory);


            //Customizing STL preferences to how I want them
            saveUserPreferences();
            setSTLExportPreferences();

            //Saving part as STL mesh
            AssemblyDoc assyDoc = (AssemblyDoc)ActiveSWModel;
            List<string> hiddenComponents = Common.findHiddenComponents(assyDoc.GetComponents(false));
            ActiveSWModel.Extension.SelectAll();
            ActiveSWModel.HideComponent2();
            string filename = exportFiles(mRobot.BaseLink, package, 0);
            mRobot.BaseLink.Visual.Geometry.Mesh.filename = filename;
            mRobot.BaseLink.Collision.Geometry.Mesh.filename = filename;
            
            Common.showAllComponents(ActiveSWModel, hiddenComponents);
            //Writing URDF to file

            URDFWriter uWriter = new URDFWriter(windowsURDFFileName);
            mRobot.writeURDF(uWriter.writer);

            resetUserPreferences();
            progressBar.End();
        }
Ejemplo n.º 3
0
        // Beginning method for exporting the full package
        public void exportRobot()
        {
            //Setting up the progress bar
            System.Diagnostics.Debug.WriteLine("Beginning the export process");
            int progressBarBound = Common.getCount(mRobot.BaseLink);

            progressBar.Start(0, progressBarBound, "Creating package directories");

            //Creating package directories
            System.Diagnostics.Debug.WriteLine("Creating package directories");
            URDFPackage package = new URDFPackage(mPackageName, mSavePath);

            package.createDirectories();
            mRobot.name = mPackageName;
            string windowsURDFFileName       = package.WindowsRobotsDirectory + mRobot.name + ".urdf";
            string windowsPackageXMLFileName = package.WindowsPackageDirectory + "package.xml";

            //Create CMakeLists
            System.Diagnostics.Debug.WriteLine("Creating CMakeLists.txt at " + package.WindowsCMakeLists);
            package.createCMakeLists();

            //Create Config joint names, not sure how this is used...
            System.Diagnostics.Debug.WriteLine("Creating joint names config at " + package.WindowsConfigYAML);
            package.createConfigYAML(mRobot.getJointNames(false));

            //Creating package.xml file
            PackageXMLWriter packageXMLWriter = new PackageXMLWriter(windowsPackageXMLFileName);
            PackageXML       packageXML       = new PackageXML(mPackageName);

            packageXML.writeElement(packageXMLWriter);

            //Creating RVIZ launch file
            Rviz rviz = new Rviz(mPackageName, mRobot.name + ".urdf");

            System.Diagnostics.Debug.WriteLine("Creating RVIZ launch file");
            rviz.writeFiles(package.WindowsLaunchDirectory);

            //Creating Gazebo launch file
            System.Diagnostics.Debug.WriteLine("Creating Gazebo launch file");
            Gazebo gazebo = new Gazebo(this.mRobot.name, this.mPackageName, mRobot.name + ".urdf");

            gazebo.writeFile(package.WindowsLaunchDirectory);


            //Customizing STL preferences to how I want them
            saveUserPreferences();
            setSTLExportPreferences();

            //Saving part as STL mesh
            AssemblyDoc   assyDoc          = (AssemblyDoc)ActiveSWModel;
            List <string> hiddenComponents = Common.findHiddenComponents(assyDoc.GetComponents(false));

            ActiveSWModel.Extension.SelectAll();
            ActiveSWModel.HideComponent2();
            string filename = exportFiles(mRobot.BaseLink, package, 0);

            mRobot.BaseLink.Visual.Geometry.Mesh.filename    = filename;
            mRobot.BaseLink.Collision.Geometry.Mesh.filename = filename;

            Common.showAllComponents(ActiveSWModel, hiddenComponents);
            //Writing URDF to file

            URDFWriter uWriter = new URDFWriter(windowsURDFFileName);

            mRobot.writeURDF(uWriter.writer);

            resetUserPreferences();
            progressBar.End();
        }