Explorar el Código

Remove unused URDF-FBX classes (#318)

Signed-off-by: Michał Pełka <[email protected]>
Michał Pełka hace 2 años
padre
commit
f0a4db8b2c

+ 0 - 69
Gems/ROS2/Code/Source/Converters/URDF/ToFBX/Constants.h

@@ -1,69 +0,0 @@
-/*
- * Copyright (c) Contributors to the Open 3D Engine Project.
- * For complete copyright and license terms please see the LICENSE at the root of this distribution.
- *
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
-
-#pragma once
-
-namespace ROS2
-{
-    namespace Fbx
-    {
-        //! The struct contains all constant parameters used in FBX files.
-        //! @note Constant values could be moved to configuration file.
-        struct Constants
-        {
-            struct FbxHeader
-            {
-                static constexpr int headerVersion = 1003;
-                static constexpr int fileVersion = 7500;
-                static constexpr const char* creatorName = "O3DE ROS2 Gem";
-                static constexpr int timeStampVersion = 1000;
-                static constexpr int metaDataVersion = 100;
-                static constexpr const char* metaDataTitle = "";
-                static constexpr int sceneInfoVersion = 100;
-                static constexpr const char* applicationName = "O3DE";
-                static constexpr const char* applicationVersion = "2022";
-                static constexpr const char* documentActiveAnimStackName = "Take 001";
-                static constexpr const char* dummyPath = "/dummy_path.fbx";
-                static constexpr const char* fileCreationDate = "01/01/2022 00:00:00.000";
-            };
-
-            struct GlobalSettings
-            {
-                static constexpr int version = 1000;
-                static constexpr int defaultTimeSpan = 1924423250;
-                static constexpr const char* defaultCamera = "Producer Perspective";
-                static constexpr int timeMode = 11;
-                static constexpr int timeProtocol = 2;
-                static constexpr int snapOnFrameMode = 0;
-                static constexpr int customFrameRate = -1;
-                static constexpr int currentTimeMarker = -1;
-            };
-
-            struct Material
-            {
-                static constexpr int defaultVersion = 102;
-                static constexpr const char* defaultShadingModel = "phong";
-                static constexpr float defaultDiffuseFactor = 0.9;
-                static constexpr float defaultOpacity = 1.0;
-                static constexpr float defaultReflectivity = 0.0;
-            };
-
-            struct Object
-            {
-                static constexpr int modelVersion = 232;
-                static constexpr int geometryVersion = 102;
-                static constexpr int layerElementNormalVersion = 102;
-                static constexpr int layerElementUvVersion = 101;
-            };
-
-            // Other
-            static constexpr int definitionsVersion = 100;
-            static constexpr const char* defaultConnectionType = "OO";
-        };
-    } // namespace Fbx
-} // namespace ROS2

+ 0 - 394
Gems/ROS2/Code/Source/Converters/URDF/ToFBX/FbxGenerator.cpp

@@ -1,394 +0,0 @@
-/*
- * Copyright (c) Contributors to the Open 3D Engine Project.
- * For complete copyright and license terms please see the LICENSE at the root of this distribution.
- *
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
-
-#include "FbxGenerator.h"
-
-#include <chrono>
-#include <ctime>
-#include <fstream>
-
-#include <AzCore/Console/Console.h>
-
-#include "Constants.h"
-
-namespace ROS2
-{
-    namespace Fbx
-    {
-        void FbxGenerator::SaveToFile(const AZStd::string& filePath, FileType type)
-        {
-            // TODO: add support for binary files
-            if (type != FileType::Text)
-            {
-                std::runtime_error(std::string(__func__) + ": Only text file type is supported!");
-            }
-
-            std::ofstream file(filePath.c_str());
-            if (!file.is_open())
-            {
-                std::runtime_error(std::string(__func__) + ": Unable to open file: " + std::string(filePath.c_str()));
-            }
-
-            file << GetFbxString().c_str();
-            AZ_Printf("Fbx", "Data structure saved to file: %s", filePath.c_str());
-        }
-
-        AZStd::string FbxGenerator::GetFbxString()
-        {
-            if (!m_nodesUpdated)
-            {
-                GenerateFbxStructure();
-            }
-
-            AZStd::string data;
-            // Traverse tree in depth-first order and generate string
-            for (const auto& n : m_basicNodes)
-            {
-                data += n.ToString(0);
-            }
-
-            return data;
-        }
-
-        void FbxGenerator::Reset()
-        {
-            m_basicNodes.clear();
-            m_nodesUpdated = false;
-            m_connections.clear();
-            m_objects = AZStd::make_shared<Node>("Objects");
-        }
-
-        Id FbxGenerator::AddCubeObject(const AZStd::string& objectName, double size, Id materialId)
-        {
-            m_nodesUpdated = false;
-
-            const auto model = CreateModel(objectName);
-            m_objects->AddChild(model.node);
-
-            const auto geometry = CreateGeometryCube(size);
-            m_objects->AddChild(std::move(geometry.node));
-
-            // Attach first object to the root node
-            if (m_first_object)
-            {
-                m_connections.push_back(Connection(rootId, model.id, Constants::defaultConnectionType));
-                m_first_object = false;
-            }
-
-            m_connections.push_back(Connection(model.id, geometry.id, Constants::defaultConnectionType));
-
-            // TODO: Would be great to add validation if materialId exists.
-            m_connections.push_back(Connection(model.id, materialId, Constants::defaultConnectionType));
-
-            return model.id;
-        }
-
-        Id FbxGenerator::AddMaterial(const AZStd::string& materialName, const Color& color)
-        {
-            m_nodesUpdated = false;
-
-            const auto material = CreateMaterial(materialName, color);
-            m_objects->AddChild(material.node);
-            return material.id;
-        }
-
-        void FbxGenerator::SetRelationBetweenObjects(Id parentId, Id childId)
-        {
-            m_nodesUpdated = false;
-            m_connections.push_back(Connection(parentId, childId, Constants::defaultConnectionType));
-        }
-
-        void FbxGenerator::GenerateFbxStructure()
-        {
-            m_basicNodes.clear();
-
-            m_basicNodes.push_back(GetFbxHeaderExtension());
-            m_basicNodes.push_back(GetGlobalSettings());
-            m_basicNodes.push_back(GetDocuments());
-            m_basicNodes.push_back(Node("References"));
-            m_basicNodes.push_back(GetDefinitions());
-            m_basicNodes.push_back(*m_objects);
-            m_basicNodes.push_back(GenerateConnections());
-            m_basicNodes.push_back(Node("Takes"));
-
-            m_nodesUpdated = true;
-        }
-
-        Node FbxGenerator::GetFbxHeaderExtension() const
-        {
-            Node fbxHeader("FBXHeaderExtension");
-            fbxHeader.AddChild("FBXHeaderVersion", Constants::FbxHeader::headerVersion);
-            fbxHeader.AddChild("FBXVersion", Constants::FbxHeader::fileVersion);
-            fbxHeader.AddChild(GetTimeStamp());
-            fbxHeader.AddChild("Creator", Constants::FbxHeader::creatorName);
-            fbxHeader.AddChild(GetSceneInfo());
-
-            return fbxHeader;
-        }
-
-        Node FbxGenerator::GetGlobalSettings() const
-        {
-            Node globalSettings("GlobalSettings");
-            globalSettings.AddChild("Version", Constants::GlobalSettings::version);
-
-            Node properties("Properties70");
-            properties.AddChild(Node("P", { "UpAxis", "int", "Integer", "", 1 }));
-            properties.AddChild(Node("P", { "UpAxisSign", "int", "Integer", "", 1 }));
-            properties.AddChild(Node("P", { "FrontAxis", "int", "Integer", "", 2 }));
-            properties.AddChild(Node("P", { "FrontAxisSign", "int", "Integer", "", 1 }));
-            properties.AddChild(Node("P", { "CoordAxis", "int", "Integer", "", 0 }));
-            properties.AddChild(Node("P", { "CoordAxisSign", "int", "Integer", "", 1 }));
-            properties.AddChild(Node("P", { "OriginalUpAxis", "int", "Integer", "", 1 }));
-            properties.AddChild(Node("P", { "OriginalUpAxisSign", "int", "Integer", "", 1 }));
-            properties.AddChild(Node("P", { "UnitScaleFactor", "double", "Number", "", 1 }));
-            properties.AddChild(Node("P", { "OriginalUnitScaleFactor", "double", "Number", "", 1 }));
-            properties.AddChild(Node("P", { "AmbientColor", "ColorRGB", "Color", "", 0, 0, 0 }));
-            properties.AddChild(Node("P", { "DefaultCamera", "KString", "", "", Constants::GlobalSettings::defaultCamera }));
-            properties.AddChild(Node("P", { "TimeMode", "enum", "", "", Constants::GlobalSettings::timeMode }));
-            properties.AddChild(Node("P", { "TimeProtocol", "enum", "", "", Constants::GlobalSettings::timeProtocol }));
-            properties.AddChild(Node("P", { "SnapOnFrameMode", "enum", "", "", Constants::GlobalSettings::snapOnFrameMode }));
-            properties.AddChild(Node("P", { "TimeSpanStart", "KTime", "Time", "", Constants::GlobalSettings::defaultTimeSpan }));
-            properties.AddChild(Node("P", { "TimeSpanStop", "KTime", "Time", "", Constants::GlobalSettings::defaultTimeSpan }));
-            properties.AddChild(Node("P", { "CustomFrameRate", "double", "Number", "", Constants::GlobalSettings::customFrameRate }));
-            properties.AddChild(Node("P", { "TimeMarker", "Compound", "", "" }));
-            properties.AddChild(Node("P", { "CurrentTimeMarker", "int", "Integer", "", Constants::GlobalSettings::currentTimeMarker }));
-
-            globalSettings.AddChild(std::move(properties));
-
-            return globalSettings;
-        }
-
-        Node FbxGenerator::GetDocuments() const
-        {
-            Node documents("Documents");
-            documents.AddChild("Count", 1);
-
-            Node document("Document", { "", "Scene" });
-
-            Node properties("Properties70");
-            properties.AddChild(Node("P", { "SourceObject", "object", "", "" }));
-            properties.AddChild(Node("P", { "ActiveAnimStackName", "KString", "", Constants::FbxHeader::documentActiveAnimStackName }));
-
-            document.AddChild(std::move(properties));
-            document.AddChild("RootNode", 0);
-            return documents;
-        }
-
-        Node FbxGenerator::GetDefinitions() const
-        {
-            Node definitions("Definitions");
-            definitions.AddChild("Version", Constants::definitionsVersion);
-            definitions.AddChild("Count", 3);
-            definitions.AddChild(Node("ObjectType", { "GlobalSettings" }, { Node("Count", { 1 }) }));
-            definitions.AddChild(Node("ObjectType", { "Model" }, { Node("Count", { 1 }) }));
-            definitions.AddChild(Node("ObjectType", { "Geometry" }, { Node("Count", { 1 }) }));
-            definitions.AddChild(Node("ObjectType", { "Material" }, { Node("Count", { 1 }) }));
-
-            return definitions;
-        }
-
-        NodeWithId FbxGenerator::CreateModel(const AZStd::string& modelName) const
-        {
-            const int modelId = UniqueIdGenerator::GetUniqueId();
-
-            Node model("Model", { modelId, modelName, "Mesh" });
-            model.AddChild("Version", Constants::Object::modelVersion);
-            model.AddChild("Culling", "CullingOff");
-
-            Node properties("Properties70");
-            properties.AddChild(Node("P", { "RotationActive", "bool", "", "", 1 }));
-            properties.AddChild(Node("P", { "InheritType", "enum", "", "", 1 }));
-            properties.AddChild(Node("P", { "ScalingMax", "Vector3D", "Vector", "", 0, 0, 0 }));
-            properties.AddChild(Node("P", { "DefaultAttributeIndex", "int", "Integer", "", 0 }));
-            properties.AddChild(Node("P", { "Lcl Scaling", "Lcl Scaling", "", "A", 100, 100, 100 }));
-            properties.AddChild(Node("P", { "currentUVSet", "KString", "", "U", "map1" }));
-            model.AddChild(std::move(properties));
-
-            return NodeWithId(modelId, model);
-        }
-
-        NodeWithId FbxGenerator::CreateMaterial(const AZStd::string& name, const Color& color) const
-        {
-            const int materialId = UniqueIdGenerator::GetUniqueId();
-
-            Node material("Material", { materialId, name, "" });
-            material.AddChild("Version", Constants::Material::defaultVersion);
-            material.AddChild("ShadingModel", Constants::Material::defaultShadingModel);
-            material.AddChild("Multilayer", 0);
-
-            // TODO: set more parameters of material
-            Node properties("Properties70");
-            properties.AddChild(Node("P", { "AmbientColor", "Color", "", "A", 0, 0, 0 }));
-            properties.AddChild(Node("P", { "DiffuseColor", "Color", "", "A", 1, 1, 1 }));
-            properties.AddChild(Node("P", { "DiffuseFactor", "Number", "", "A", Constants::Material::defaultDiffuseFactor }));
-            properties.AddChild(Node("P", { "TransparencyFactor", "Number", "", "A", 1 }));
-            properties.AddChild(Node("P", { "SpecularColor", "Color", "", "A", color.r, color.g, color.b }));
-            properties.AddChild(Node("P", { "ReflectionFactor", "Number", "", "A", 0.5 }));
-            properties.AddChild(Node("P", { "Emissive", "Vector3D", "Vector", "", 0, 0, 0 }));
-            properties.AddChild(Node("P", { "Ambient", "Vector3D", "Vector", "", 0, 0, 0 }));
-            properties.AddChild(Node("P", { "Diffuse", "Vector3D", "Vector", "", 0.9, 0.9, 0.9 }));
-            properties.AddChild(Node("P", { "Specular", "Vector3D", "Vector", "", 0.5, 0.5, 0.5 }));
-            properties.AddChild(Node("P", { "Shininess", "double", "Number", "", 20 }));
-            properties.AddChild(Node("P", { "Opacity", "double", "Number", "", Constants::Material::defaultOpacity }));
-            properties.AddChild(Node("P", { "Reflectivity", "double", "Number", "", Constants::Material::defaultReflectivity }));
-            material.AddChild(std::move(properties));
-
-            return NodeWithId(materialId, material);
-        }
-
-        NodeWithId FbxGenerator::CreateGeometryCube(double size) const
-        {
-            // Syntax of geometry
-            // Geometry: "name", "Mesh" {
-            //      Vertices: [...]
-            //      PolygonVertexIndex: [...]
-            //      LayerElementNormal: { }
-            //      LayerElementUV: { }
-            // }
-            const int geometryId = UniqueIdGenerator::GetUniqueId();
-
-            // Example cube geometry
-            Node geometry("Geometry", { geometryId, "Geometry::cube", "Mesh" });
-            geometry.AddChild("GeometryVersion", Constants::Object::geometryVersion);
-
-            // Vertices
-            // Single vertex v1: v1_x, v1_y, v1_z
-            // Multiple vertices: v1_x, v1_y, v1_z, v2_x, v2_y, v2_z, ..., vn_x, vn_y, vn_z
-            // More details: https://banexdevblog.wordpress.com/2014/06/23/a-quick-tutorial-about-the-fbx-ascii-format/
-            Node vertices("Vertices", { RawString("*24") });
-            vertices.AddChild(Node("a", { -size, -size, size,  size, -size, size,  -size, size,  size,  size, size,  size,
-                                          -size, size,  -size, size, size,  -size, -size, -size, -size, size, -size, -size }));
-            geometry.AddChild(vertices);
-
-            // Indices of four-sided polygons (quads)
-            Node polygonVertexIndex("PolygonVertexIndex", { RawString("*24") });
-            polygonVertexIndex.AddChild(Node("a", { 0, 1, 3, -3, 2, 3, 5, -5, 4, 5, 7, -7, 6, 7, 1, -1, 1, 7, 5, -4, 6, 0, 2, -5 }));
-            geometry.AddChild(polygonVertexIndex);
-
-            // Edges
-            Node edges("Edges", { RawString("*12") });
-            edges.AddChild(Node("a", { 0, 2, 6, 10, 3, 1, 7, 5, 11, 9, 15, 13 }));
-            geometry.AddChild(edges);
-
-            // Normals
-            auto layerElementNormal = Node("LayerElementNormal", { 0 });
-            layerElementNormal.AddChild("Version", Constants::Object::layerElementNormalVersion);
-            layerElementNormal.AddChild("Name", "");
-            layerElementNormal.AddChild("MappingInformationType", "ByPolygonVertex");
-            layerElementNormal.AddChild("ReferenceInformationType", "Direct");
-
-            Node normals("Normals", { RawString("*72") });
-            normals.AddChild(Node("a", { 0, 0, 1,  0, 0, 1,  0, 0, 1,  0, 0, 1,  0,  1,  0, 0,  1,  0, 0,  1,  0, 0,  1,  0,
-                                         0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0,  -1, 0, 0,  -1, 0, 0,  -1, 0, 0,  -1, 0,
-                                         1, 0, 0,  1, 0, 0,  1, 0, 0,  1, 0, 0,  -1, 0,  0, -1, 0,  0, -1, 0,  0, -1, 0,  0 }));
-            layerElementNormal.AddChild(normals);
-
-            Node normalsSw("NormalsW", { RawString("*24") });
-            normalsSw.AddChild(Node("a", { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }));
-            layerElementNormal.AddChild(normalsSw);
-
-            geometry.AddChild(layerElementNormal);
-
-            // UV
-            auto layerElementUV = Node("LayerElementUV", { 0 });
-            layerElementUV.AddChild("Version", Constants::Object::layerElementUvVersion);
-            layerElementUV.AddChild("Name", "map1");
-            layerElementUV.AddChild("MappingInformationType", "ByPolygonVertex");
-            layerElementUV.AddChild("ReferenceInformationType", "IndexToDirect");
-
-            Node uv("UV", { RawString("*28") });
-            uv.AddChild(Node("a", { 0.375, 0,    0.625, 0, 0.375, 0.25, 0.625, 0.25, 0.375, 0.5,  0.625, 0.5, 0.375, 0.75,
-                                    0.625, 0.75, 0.375, 1, 0.625, 1,    0.875, 0,    0.875, 0.25, 0.125, 0,   0.125, 0.25 }));
-            layerElementUV.AddChild(uv);
-
-            Node uvIndex("UVIndex", { RawString("*28") });
-            uvIndex.AddChild(Node("a", { 0, 1, 3, 2, 2, 3, 5, 4, 4, 5, 7, 6, 6, 7, 9, 8, 1, 10, 11, 3, 12, 0, 2, 13 }));
-            layerElementUV.AddChild(uvIndex);
-
-            geometry.AddChild(layerElementUV);
-
-            return NodeWithId(geometryId, geometry);
-        }
-
-        Node FbxGenerator::GenerateConnections() const
-        {
-            Node connections("Connections");
-            for (const auto& c : m_connections)
-            {
-                connections.AddChild(Node("C", { c.type, c.childId, c.parentId }));
-            }
-
-            return connections;
-        }
-
-        Node FbxGenerator::GetTimeStamp() const
-        {
-            auto now = std::chrono::system_clock::now();
-            std::time_t now_c = std::chrono::system_clock::to_time_t(now);
-            struct tm* parts = std::localtime(&now_c);
-
-            Node timeStamp("CreationTimeStamp");
-            timeStamp.AddChild("Version", Constants::FbxHeader::timeStampVersion);
-            timeStamp.AddChild("Year", 1900 + parts->tm_year);
-            timeStamp.AddChild("Month", 1 + parts->tm_mon);
-            timeStamp.AddChild("Day", parts->tm_mday);
-            timeStamp.AddChild("Hour", parts->tm_hour);
-            timeStamp.AddChild("Minute", parts->tm_min);
-            timeStamp.AddChild("Second", 0);
-            timeStamp.AddChild("Millisecond", 0);
-
-            return timeStamp;
-        }
-
-        Node FbxGenerator::GetSceneInfo() const
-        {
-            Node sceneInfo("SceneInfo");
-            sceneInfo.AddProperty("SceneInfo::GlobalInfo");
-            sceneInfo.AddProperty("UserData");
-            sceneInfo.AddChild("Type", "UserData");
-            sceneInfo.AddChild("Version", Constants::FbxHeader::sceneInfoVersion);
-            sceneInfo.AddChild(GetMetaData());
-
-            Node properties("Properties70");
-            properties.AddChild(Node("P", { "DocumentUrl", "KString", "Url", "", Constants::FbxHeader::dummyPath }));
-            properties.AddChild(Node("P", { "SrcDocumentUrl", "KString", "Url", "", Constants::FbxHeader::dummyPath }));
-            properties.AddChild(Node("P", { "Original", "Compound", "", "" }));
-            properties.AddChild(Node("P", { "Original|ApplicationVendor", "KString", "", "", Constants::FbxHeader::applicationName }));
-            properties.AddChild(Node("P", { "Original|ApplicationName", "KString", "", "", Constants::FbxHeader::applicationName }));
-            properties.AddChild(Node("P", { "Original|ApplicationVersion", "KString", "", "", Constants::FbxHeader::applicationVersion }));
-            properties.AddChild(Node("P", { "Original|DateTime_GMT", "DateTime", "", "", Constants::FbxHeader::fileCreationDate }));
-            properties.AddChild(Node("P", { "Original|FileName", "KString", "", "", Constants::FbxHeader::dummyPath }));
-            properties.AddChild(Node("P", { "LastSaved", "Compound", "", "" }));
-            properties.AddChild(Node("P", { "LastSaved|ApplicationVendor", "KString", "", "", Constants::FbxHeader::applicationName }));
-            properties.AddChild(Node("P", { "LastSaved|ApplicationName", "KString", "", "", Constants::FbxHeader::applicationName }));
-            properties.AddChild(Node("P", { "LastSaved|ApplicationVersion", "KString", "", "", Constants::FbxHeader::applicationVersion }));
-            properties.AddChild(Node("P", { "LastSaved|DateTime_GMT", "DateTime", "", "", Constants::FbxHeader::fileCreationDate }));
-            properties.AddChild(Node("P", { "Original|ApplicationActiveProject", "KString", "", "", Constants::FbxHeader::dummyPath }));
-            properties.AddChild(Node("P", { "Original|ApplicationNativeFile", "KString", "", "", Constants::FbxHeader::dummyPath }));
-
-            sceneInfo.AddChild(std::move(properties));
-
-            return sceneInfo;
-        }
-
-        Node FbxGenerator::GetMetaData() const
-        {
-            Node metaData("MetaData");
-            metaData.AddChild("Version", Constants::FbxHeader::metaDataVersion);
-            metaData.AddChild("Title", Constants::FbxHeader::metaDataTitle);
-            metaData.AddChild("Subject", "");
-            metaData.AddChild("Author", "");
-            metaData.AddChild("Keywords", "");
-            metaData.AddChild("Revision", "");
-            metaData.AddChild("Comment", "");
-
-            return metaData;
-        }
-
-    } // namespace Fbx
-} // namespace ROS2

+ 0 - 152
Gems/ROS2/Code/Source/Converters/URDF/ToFBX/FbxGenerator.h

@@ -1,152 +0,0 @@
-/*
- * Copyright (c) Contributors to the Open 3D Engine Project.
- * For complete copyright and license terms please see the LICENSE at the root of this distribution.
- *
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
-
-#pragma once
-
-#include <AzCore/Memory/SystemAllocator.h>
-#include <AzCore/std/containers/vector.h>
-#include <AzCore/std/smart_ptr/make_shared.h>
-#include <AzCore/std/string/string.h>
-
-#include "FbxNode.h"
-#include "UniqueIdGenerator.h"
-
-namespace ROS2
-{
-    namespace Fbx
-    {
-        //! Define type of the FBX file.
-        enum class FileType
-        {
-            Text,
-            Binary
-        };
-
-        //! RGB color
-        struct Color
-        {
-            Color(float r, float g, float b)
-                : r(r)
-                , g(g)
-                , b(b){};
-            float r = 0;
-            float g = 0;
-            float b = 0;
-        };
-
-        //! The class represents the FBX file structure generator and operations on that files.
-        //!
-        //! FBX file has a tree based structure.
-        //! Top structure of the FBX file consists of the following sections:
-        //!   - FBXHeaderExtension (mandatory) - metadata of file.
-        //!   - GlobalSettings (mandatory) - general data properties.
-        //!   - Documents (optional) - ?
-        //!   - References (optional) - ?
-        //!   - Definitions (optional) - ?
-        //!   - Objects (optional) - static data storage like objects, geometries, textures and materials.
-        //!   - Connections (optional) - defines connections between data defined in Objects.
-        //!                              For example which object uses specific material.
-        //!   - Takes (optional) - animations definitions.
-        //!
-        //! Additional documentation about FBX structure:
-        //! https://web.archive.org/web/20160605023014/https://wiki.blender.org/index.php/User:Mont29/Foundation/FBX_File_Structure
-        //! https://banexdevblog.wordpress.com/2014/06/23/a-quick-tutorial-about-the-fbx-ascii-format/
-        //!
-        //! Example FBX file
-        //! https://www.ics.uci.edu/~djp3/classes/2014_03_ICS163/tasks/arMarker/Unity/arMarker/Assets/CactusPack/Meshes/Sprites/Rock_Medium_SPR.fbx
-        class FbxGenerator
-        {
-        public:
-            AZ_CLASS_ALLOCATOR(FbxGenerator, AZ::SystemAllocator, 0);
-
-            //! Save the current FBX structure to file.
-            //! @note only ASCII version is supported.
-            //! @param filePath is a path of the generated file.
-            //! @param type of the generated FBX file.
-            void SaveToFile(const AZStd::string& filePath, FileType type = FileType::Text);
-
-            //! Get the string with FBX data.
-            //! @return The string with ASCII version of current FBX structure.
-            AZStd::string GetFbxString();
-
-            //! Reset the internal data used for FBX file structure creation.
-            void Reset();
-
-            //! Add cube object.
-            //! Notice: First added object is attached to the root node.
-            //! @note TODO: generalization for other types of objects e.g. cuboid, cylinder
-            //! @note TODO: handle textures.
-            //! @param objectName A name of created object.
-            //! @param size A size of the cube in meters.
-            //! @param materialId The id of the created previously material that will be used in object.
-            //! @return id of created object.
-            Id AddCubeObject(const AZStd::string& objectName, double size, Id materialId);
-
-            //! Add default material and return its id.
-            //! @note TODO: add more material parameters.
-            //! @return id of created material.
-            Id AddMaterial(const AZStd::string& materialName, const Color& color);
-
-            //! Create relation between objects
-            //! @param parentId The id of the parent object in created relation.
-            //! @param parentId The id of the child object in created relation.
-            void SetRelationBetweenObjects(Id parentId, Id childId);
-
-        private:
-            //! Represents the connection between two objects.
-            struct Connection
-            {
-                AZ_CLASS_ALLOCATOR(Connection, AZ::SystemAllocator, 0);
-
-                Connection(Id parent, Id child, AZStd::string connectionType)
-                    : parentId(parent)
-                    , childId(child)
-                    , type(connectionType)
-                {
-                }
-
-                Id parentId = -1;
-                Id childId = -1;
-                AZStd::string type = "OO";
-            };
-
-            //! Generate the FBX file structure.
-            void GenerateFbxStructure();
-
-            // Default FBX file header
-            Node GetFbxHeaderExtension() const;
-            Node GetTimeStamp() const;
-            Node GetSceneInfo() const;
-            Node GetMetaData() const;
-
-            // Default global settings
-            Node GetGlobalSettings() const;
-
-            Node GetDocuments() const;
-            Node GetDefinitions() const;
-
-            // Objects creation
-            NodeWithId CreateModel(const AZStd::string& modelName) const;
-            NodeWithId CreateMaterial(const AZStd::string& name, const Color& color) const;
-            NodeWithId CreateGeometryCube(double size = 1.0) const;
-
-            // Generate connections based on the m_connections.
-            Node GenerateConnections() const;
-
-            static constexpr Id rootId = 0;
-
-            AZStd::vector<Node> m_basicNodes;
-            bool m_nodesUpdated = false;
-            AZStd::vector<Connection> m_connections;
-
-            AZStd::shared_ptr<Node> m_objects = AZStd::make_shared<Node>("Objects");
-            bool m_first_object = true;
-        };
-
-    } // namespace Fbx
-} // namespace ROS2

+ 0 - 166
Gems/ROS2/Code/Source/Converters/URDF/ToFBX/FbxNode.cpp

@@ -1,166 +0,0 @@
-/*
- * Copyright (c) Contributors to the Open 3D Engine Project.
- * For complete copyright and license terms please see the LICENSE at the root of this distribution.
- *
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
-
-#include "FbxNode.h"
-
-#include <fstream>
-#include <iomanip>
-#include <string>
-
-#include <AzCore/Console/Console.h>
-#include <AzCore/std/string/string.h>
-
-namespace ROS2
-{
-    namespace Fbx
-    {
-        AZStd::string AnyToString(const std::any& a)
-        {
-            if (a.type() == typeid(int))
-            {
-                return std::to_string(std::any_cast<int>(a)).c_str();
-            }
-            else if (a.type() == typeid(unsigned))
-            {
-                return std::to_string(std::any_cast<unsigned>(a)).c_str();
-            }
-            else if (a.type() == typeid(float))
-            {
-                return std::to_string(std::any_cast<float>(a)).c_str();
-            }
-            else if (a.type() == typeid(double))
-            {
-                return std::to_string(std::any_cast<double>(a)).c_str();
-            }
-            else if (a.type() == typeid(const char*))
-            {
-                return AZStd::string("\"") + std::any_cast<const char*>(a) + AZStd::string("\"");
-            }
-            else if (a.type() == typeid(AZStd::string))
-            {
-                return AZStd::string("\"") + std::any_cast<AZStd::string>(a).c_str() + AZStd::string("\"");
-            }
-            else if (a.type() == typeid(RawString))
-            {
-                return std::any_cast<RawString>(a).data.c_str();
-            }
-
-            AZ_Warning(__func__, false, "Unhandled type: %s", a.type().name());
-            return "";
-        }
-
-        Node::Node(const AZStd::string& name, const Properties& properties, const Nodes& children)
-            : m_name(name)
-            , m_properties(properties)
-            , m_children(children)
-        {
-        }
-
-        AZStd::string Node::GetName() const
-        {
-            return m_name;
-        }
-
-        Nodes Node::GetChildren() const
-        {
-            return m_children;
-        }
-
-        Properties Node::GetProperties() const
-        {
-            return m_properties;
-        }
-
-        bool Node::HasChildren() const
-        {
-            return !m_children.empty();
-        }
-
-        bool Node::HasProperties() const
-        {
-            return !m_properties.empty();
-        }
-
-        void Node::AddProperty(const Property& property)
-        {
-            m_properties.push_back(property);
-        }
-
-        void Node::AddChild(const Node& child)
-        {
-            m_children.push_back(child);
-        }
-
-        void Node::AddChild(const AZStd::string& name, const Property& property)
-        {
-            m_children.push_back(Node(name, { property }));
-        }
-
-        void Node::AddChild(const Node&& child)
-        {
-            m_children.push_back(child);
-        }
-
-        AZStd::string Node::ToString(int nodeDepth) const
-        {
-            // Calculate offset
-            constexpr int spacesPerIndentLevel = 2;
-            std::stringstream offsetStream;
-            offsetStream << std::setfill(' ') << std::setw(nodeDepth * spacesPerIndentLevel) << "";
-            std::string offset = offsetStream.str();
-
-            // Write name
-            std::stringstream ss;
-            ss << offset << m_name.data() << ": ";
-
-            if (!HasProperties() && !HasChildren())
-            {
-                ss << " {\n";
-                ss << offset << "}";
-            }
-
-            // Write properties
-            if (HasProperties())
-            {
-                bool hasPrevious = false;
-                for (const auto& property : m_properties)
-                {
-                    if (hasPrevious)
-                    {
-                        ss << ", ";
-                    }
-                    (void)property;
-                    ss << AnyToString(property).c_str();
-                    hasPrevious = true;
-                }
-            }
-
-            // Write child nodes
-            if (HasChildren())
-            {
-                ss << " {\n";
-
-                if (m_children.size() > 0)
-                {
-                    for (auto node : m_children)
-                    {
-                        ss << node.ToString(nodeDepth + 1).c_str();
-                    }
-                }
-                ss << offset << "}\n";
-            }
-            else
-            {
-                ss << "\n";
-            }
-
-            return ss.str().c_str();
-        }
-
-    } // namespace Fbx
-} // namespace ROS2

+ 0 - 108
Gems/ROS2/Code/Source/Converters/URDF/ToFBX/FbxNode.h

@@ -1,108 +0,0 @@
-/*
- * Copyright (c) Contributors to the Open 3D Engine Project.
- * For complete copyright and license terms please see the LICENSE at the root of this distribution.
- *
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
-
-#pragma once
-
-#include <any>
-
-#include <AzCore/Memory/SystemAllocator.h>
-#include <AzCore/std/containers/vector.h>
-#include <AzCore/std/string/string.h>
-
-#include "UniqueIdGenerator.h"
-
-namespace ROS2
-{
-    namespace Fbx
-    {
-        //! The property of the FBX node.
-        using Property = std::any;
-        //! The collection of properties of the FBX node.
-        using Properties = AZStd::vector<Property>;
-        //! The collection of the FBX ndoes.
-        using Nodes = AZStd::vector<class Node>;
-
-        //! Represents raw string without quotation marks for Node properties purposes.
-        //! String values are quoted by default when added as node properties.
-        //! But in very rare cases it's necessary to add field without quotation marks.
-        struct RawString
-        {
-            RawString(const AZStd::string& str)
-                : data(str)
-            {
-            }
-            AZStd::string data;
-        };
-
-        //! A node in the FBX file tree structure.
-        //! Each named node could contain children nodes (subnodes) and multiple properties.
-        class Node
-        {
-        public:
-            AZ_CLASS_ALLOCATOR(Node, AZ::SystemAllocator, 0);
-
-            Node(const AZStd::string& name, const Properties& properties = {}, const Nodes& children = {});
-
-            //! Get name of the node.
-            //! @return A name of the node.
-            AZStd::string GetName() const;
-            //! Get children of the node.
-            //! @return All direct children nodes of the node.
-            Nodes GetChildren() const;
-            //! Get properties of the node.
-            //! @return All properties of the node.
-            Properties GetProperties() const;
-            //! Check whether the node has children.
-            bool HasChildren() const;
-            //! Check whether the node has properties.
-            bool HasProperties() const;
-
-            //! Add new property to existing node
-            //! @param property A property that will be added to node.
-            void AddProperty(const Property& property);
-
-            //! Add new child node to existing node.
-            void AddChild(const Node& child);
-            //! Add new child node to existing node.
-            void AddChild(const AZStd::string& name, const Property& property);
-            //! Add new child node to existing node.
-            void AddChild(const Node&& child);
-
-            //! Convert the node to string (ASCII Fbx).
-            //! @param nodeDepth A node depth in FBX tree structure.
-            //! Used to calculate offset in text version of the node.
-            //! @return A string that contains text version of the node.
-            AZStd::string ToString(int nodeDepth = 0) const;
-
-        private:
-            AZStd::string m_name;
-            Nodes m_children;
-            Properties m_properties;
-        };
-
-        //! A node with unique id
-        struct NodeWithId
-        {
-            NodeWithId(Id id, const Node& node)
-                : id(id)
-                , node(node)
-            {
-            }
-
-            NodeWithId(Id id, const Node&& node)
-                : id(id)
-                , node(std::move(node))
-            {
-            }
-
-            Id id;
-            Node node;
-        };
-
-    } // namespace Fbx
-} // namespace ROS2

+ 0 - 33
Gems/ROS2/Code/Source/Converters/URDF/ToFBX/UniqueIdGenerator.h

@@ -1,33 +0,0 @@
-/*
- * Copyright (c) Contributors to the Open 3D Engine Project.
- * For complete copyright and license terms please see the LICENSE at the root of this distribution.
- *
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
-
-#pragma once
-
-namespace ROS2
-{
-    using Id = int;
-
-    //! Generate unique, positive id
-    class UniqueIdGenerator
-    {
-    public:
-        static Id GetUniqueId()
-        {
-            m_counter++;
-            return static_cast<Id>(m_counter);
-        }
-
-        static void Reset()
-        {
-            m_counter = 0;
-        }
-
-    private:
-        inline static int m_counter = 0;
-    };
-} // namespace ROS2

+ 0 - 103
Gems/ROS2/Code/Source/Converters/URDF/ToFBX/UrdfToFbxConverter.cpp

@@ -1,103 +0,0 @@
-/*
- * Copyright (c) Contributors to the Open 3D Engine Project.
- * For complete copyright and license terms please see the LICENSE at the root of this distribution.
- *
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
-
-#include "UrdfToFbxConverter.h"
-
-#include <AzCore/Console/Console.h>
-#include <AzCore/std/string/string.h>
-
-namespace ROS2
-{
-    AZStd::string UrdfToFbxConverter::Convert(const AZStd::string& urdfString)
-    {
-        // 1. Parse URDF
-        const auto urdf = UrdfParser::Parse(urdfString.data());
-
-        // 2. Add materials to FBX
-        AddMaterialsToFbxGenerator(urdf);
-
-        // 3. Add links from URDF based structure to FBX generator in Depth First order
-        const auto root = urdf->getRoot();
-
-        std::stack<urdf::Link> stack;
-        stack.push(*root);
-
-        while (!stack.empty())
-        {
-            const auto link = stack.top();
-            stack.pop();
-
-            AddLinkToFbxGenerator(link);
-
-            // Add childs to stack
-            for (const auto& child : link.child_links)
-            {
-                stack.push(*child);
-            }
-        }
-
-        return m_generator.GetFbxString().data();
-    }
-
-    AZStd::string UrdfToFbxConverter::ConvertAndSaveToFile(const AZStd::string& urdfString, const AZStd::string& filePath)
-    {
-        const auto fbxContent = Convert(urdfString);
-        m_generator.SaveToFile(filePath.data());
-
-        return fbxContent;
-    }
-
-    void UrdfToFbxConverter::AddLinkToFbxGenerator(const urdf::Link& link)
-    {
-        const auto linkGeometry = link.visual->geometry;
-
-        if (linkGeometry->type == urdf::Geometry::BOX)
-        {
-            auto boxGeometry = std::dynamic_pointer_cast<urdf::Box>(linkGeometry);
-            const double cubeSize = boxGeometry->dim.x; // TODO: Handle box in FBX instead of cube
-            AZStd::string materialName(link.visual->material_name.c_str());
-            auto objectId = m_generator.AddCubeObject(link.name.c_str(), cubeSize, m_materialNamesToIds[materialName]);
-            m_objectNameToObjectId[link.name.c_str()] = objectId;
-        }
-        else
-        {
-            AZ_Warning(__func__, false, "Only box geometry is supported.");
-        }
-
-        // Set proper relations between links (only root has no parent)
-        // TODO: handle joints tranformations
-        if (const auto& parent = link.getParent())
-        {
-            const auto parentId = m_objectNameToObjectId[parent->name.c_str()];
-            const auto childId = m_objectNameToObjectId[link.name.c_str()];
-            m_generator.SetRelationBetweenObjects(parentId, childId);
-        }
-    }
-
-    void UrdfToFbxConverter::AddMaterialsToFbxGenerator(const urdf::ModelInterfaceSharedPtr& urdfModel)
-    {
-        if (!urdfModel)
-        {
-            AZ_Error(__func__, false, "Missing URDF model.");
-            return;
-        }
-
-        for (const auto& e : urdfModel->materials_)
-        {
-            const auto material = e.second;
-            const AZStd::string materialName(material->name.c_str());
-            const auto materialColor = material->color;
-            const Fbx::Color fbxColor(materialColor.r, materialColor.g, materialColor.b);
-            const auto materialId = m_generator.AddMaterial(materialName, fbxColor);
-            m_materialNamesToIds[materialName] = materialId;
-
-            AZ_Printf(__func__, "Add new material: %s", materialName.c_str());
-        }
-    }
-
-} // namespace ROS2

+ 0 - 41
Gems/ROS2/Code/Source/Converters/URDF/ToFBX/UrdfToFbxConverter.h

@@ -1,41 +0,0 @@
-/*
- * Copyright (c) Contributors to the Open 3D Engine Project.
- * For complete copyright and license terms please see the LICENSE at the root of this distribution.
- *
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
-
-#pragma once
-
-#include <AzCore/std/string/string.h>
-
-#include <AzCore/Memory/SystemAllocator.h>
-#include <AzCore/std/containers/map.h>
-#include <AzCore/std/string/string.h>
-
-#include "FbxGenerator.h"
-#include "RobotImporter/URDF/UrdfParser.h"
-
-namespace ROS2
-{
-    //! Class for conversion from URDF to Filmbox (.fbx) files
-    class UrdfToFbxConverter
-    {
-    public:
-        AZ_CLASS_ALLOCATOR(UrdfToFbxConverter, AZ::SystemAllocator, 0);
-
-        AZStd::string Convert(const AZStd::string& urdfString);
-
-        AZStd::string ConvertAndSaveToFile(const AZStd::string& urdfString, const AZStd::string& filePath);
-
-    private:
-        void AddLinkToFbxGenerator(const urdf::Link& urdfLink);
-        void AddMaterialsToFbxGenerator(const urdf::ModelInterfaceSharedPtr& urdfModel);
-
-        Fbx::FbxGenerator m_generator;
-        AZStd::map<AZStd::string, Id> m_materialNamesToIds;
-        AZStd::map<AZStd::string, Id> m_objectNameToObjectId;
-    };
-
-} // namespace ROS2

+ 0 - 70
Gems/ROS2/Code/Tests/FbxGeneratorTest.cpp

@@ -1,70 +0,0 @@
-/*
- * Copyright (c) Contributors to the Open 3D Engine Project.
- * For complete copyright and license terms please see the LICENSE at the root of this distribution.
- *
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
-
-#include <Converters/URDF/ToFBX/FbxGenerator.h>
-
-#include <AzCore/UnitTest/TestTypes.h>
-#include <AzTest/AzTest.h>
-
-namespace UnitTest
-{
-
-    using namespace ROS2::Fbx;
-
-    class FbxGeneratorTest : public AllocatorsTestFixture
-    {
-    public:
-        void PrintFbxContent(const AZStd::string& str)
-        {
-            std::cout << __func__ << " fbx data:"
-                      << "\n---------------\n"
-                      << str.c_str() << "\n---------------\n";
-        }
-    };
-
-    TEST_F(FbxGeneratorTest, BasicStructureGeneration)
-    {
-        FbxGenerator generator;
-
-        const auto fbxStr = generator.GetFbxString();
-
-        std::istringstream iss(fbxStr.data());
-        std::string line;
-
-        std::getline(iss, line);
-        EXPECT_EQ(line, "FBXHeaderExtension:  {");
-
-        std::getline(iss, line);
-        EXPECT_EQ(line, "  FBXHeaderVersion: 1003");
-
-        std::getline(iss, line);
-        EXPECT_EQ(line, "  FBXVersion: 7500");
-
-        std::getline(iss, line);
-        EXPECT_EQ(line, "  CreationTimeStamp:  {");
-    }
-
-    TEST_F(FbxGeneratorTest, AddModelAndMaterial)
-    {
-        FbxGenerator generator;
-
-        // Add material
-        Color color(0.0, 0.0, 0.0);
-        const auto materialId = generator.AddMaterial("black", color);
-
-        // Add cube object with specific material
-        const double cubeSize = 1.0; // m
-        const auto cubeId = generator.AddCubeObject("cube", cubeSize, materialId);
-
-        EXPECT_EQ(static_cast<int>(cubeId), 2);
-
-        const auto fbxStr = generator.GetFbxString();
-        PrintFbxContent(fbxStr);
-    }
-
-} // namespace UnitTest

+ 7 - 1
Gems/ROS2/Code/Tests/UrdfParserTest.cpp

@@ -21,6 +21,9 @@ namespace UnitTest
         AZStd::string GetUrdfWithOneLink()
         AZStd::string GetUrdfWithOneLink()
         {
         {
             return "<robot name=\"test_one_link\">"
             return "<robot name=\"test_one_link\">"
+                   "  <material name=\"black\">\n"
+                   "    <color rgba=\"0 0 0 1\"/>\n"
+                   "  </material>"
                    "  <link name=\"link1\">"
                    "  <link name=\"link1\">"
                    "    <inertial>"
                    "    <inertial>"
                    "      <mass value=\"1.0\"/>"
                    "      <mass value=\"1.0\"/>"
@@ -43,7 +46,10 @@ namespace UnitTest
 
 
         AZStd::string GetUrdfWithTwoLinksAndJoint()
         AZStd::string GetUrdfWithTwoLinksAndJoint()
         {
         {
-            return "<robot name=\"test_two_links_one_joint\">"
+            return "<robot name=\"test_two_links_one_joint\">  "
+                   "  <material name=\"black\">\n"
+                   "    <color rgba=\"0 0 0 1\"/>\n"
+                   "  </material>"
                    "  <link name=\"link1\">"
                    "  <link name=\"link1\">"
                    "    <inertial>"
                    "    <inertial>"
                    "      <mass value=\"1.0\"/>"
                    "      <mass value=\"1.0\"/>"

+ 0 - 256
Gems/ROS2/Code/Tests/UrdfToFbxConverterTest.cpp

@@ -1,256 +0,0 @@
-/*
- * Copyright (c) Contributors to the Open 3D Engine Project.
- * For complete copyright and license terms please see the LICENSE at the root of this distribution.
- *
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
-
-#include <Converters/URDF/ToFBX/UrdfToFbxConverter.h>
-
-#include <AzCore/UnitTest/TestTypes.h>
-#include <AzCore/std/string/string.h>
-#include <AzTest/AzTest.h>
-
-namespace UnitTest
-{
-
-    class UrdfToFbxConverterTest : public AllocatorsTestFixture
-    {
-    public:
-        AZStd::string GetUrdfWithOneLink()
-        {
-            return "<robot name=\"test_one_link\">"
-                   "  <material name=\"black\">"
-                   "    <color rgba=\"0.0 0.0 0.0 1.0\"/>"
-                   "  </material>"
-                   "  <link name=\"link1\">"
-                   "    <inertial>"
-                   "      <mass value=\"1.0\"/>"
-                   "      <inertia ixx=\"1.0\" iyy=\"1.0\" izz=\"1.0\" ixy=\"0\" ixz=\"0\" iyz=\"0\"/>"
-                   "    </inertial>"
-                   "    <visual>"
-                   "      <geometry>"
-                   "        <box size=\"1.0 2.0 1.0\"/>"
-                   "      </geometry>"
-                   "      <material name=\"black\"/>"
-                   "    </visual>"
-                   "    <collision>"
-                   "      <geometry>"
-                   "        <box size=\"1.0 2.0 1.0\"/>"
-                   "      </geometry>"
-                   "    </collision>"
-                   "  </link>"
-                   "</robot>";
-        }
-
-        AZStd::string GetUrdfWithTwoLinksAndOneJoint()
-        {
-            return "<robot name=\"test_one_link\">"
-                   "  <material name=\"black\">"
-                   "    <color rgba=\"0.0 0.0 0.0 1.0\"/>"
-                   "  </material>"
-                   "  <material name=\"blue\">"
-                   "    <color rgba=\"0.0 0.0 0.8 1.0\"/>"
-                   "  </material>"
-                   "  <link name=\"link1\">"
-                   "    <inertial>"
-                   "      <mass value=\"1.0\"/>"
-                   "      <inertia ixx=\"1.0\" iyy=\"1.0\" izz=\"1.0\" ixy=\"0\" ixz=\"0\" iyz=\"0\"/>"
-                   "    </inertial>"
-                   "    <visual>"
-                   "      <geometry>"
-                   "        <box size=\"1.0 2.0 1.0\"/>"
-                   "      </geometry>"
-                   "      <material name=\"black\"/>"
-                   "    </visual>"
-                   "    <collision>"
-                   "      <geometry>"
-                   "        <box size=\"1.0 2.0 1.0\"/>"
-                   "      </geometry>"
-                   "    </collision>"
-                   "  </link>"
-                   "  <link name=\"link2\">"
-                   "    <inertial>"
-                   "      <mass value=\"1.0\"/>"
-                   "      <inertia ixx=\"1.0\" iyy=\"1.0\" izz=\"1.0\" ixy=\"0\" ixz=\"0\" iyz=\"0\"/>"
-                   "    </inertial>"
-                   "    <visual>"
-                   "      <geometry>"
-                   "        <box size=\"1.0 2.0 1.0\"/>"
-                   "      </geometry>"
-                   "      <material name=\"blue\"/>"
-                   "    </visual>"
-                   "    <collision>"
-                   "      <geometry>"
-                   "        <box size=\"2.0 2.0 1.0\"/>"
-                   "      </geometry>"
-                   "    </collision>"
-                   "  </link>"
-                   "  <joint name=\"joint1\" type=\"continuous\">"
-                   "    <parent link=\"link1\"/>"
-                   "    <child link=\"link2\"/>"
-                   "    <origin xyz=\"0.5 0.25 0.0\" rpy=\"0 0 0\"/>"
-                   "    <axis xyz=\"0 0 1\"/>"
-                   "  </joint>"
-                   "</robot>";
-        }
-
-        AZStd::string GetSimpleRobotUrdf()
-        {
-            return "<robot name=\"simple_robot\">"
-                   "  <material name=\"black\">"
-                   "    <color rgba=\"0.0 0.0 0.0 1.0\"/>"
-                   "  </material>"
-                   "  <material name=\"blue\">"
-                   "    <color rgba=\"0.0 0.0 0.8 1.0\"/>"
-                   "  </material>"
-                   "  <link name=\"base_link\">"
-                   "    <visual>"
-                   "      <geometry>"
-                   "        <box size=\"1.0 2.0 1.0\"/>"
-                   "      </geometry>"
-                   "      <material name=\"blue\"/>"
-                   "    </visual>"
-                   "  </link>"
-                   "  <link name=\"wheel_bl\">"
-                   "    <visual>"
-                   "      <geometry>"
-                   "        <box size=\"1.0 2.0 1.0\"/>"
-                   "      </geometry>"
-                   "      <material name=\"black\"/>"
-                   "    </visual>"
-                   "  </link>"
-                   "  <link name=\"wheel_br\">"
-                   "    <visual>"
-                   "      <geometry>"
-                   "        <box size=\"1.0 2.0 1.0\"/>"
-                   "      </geometry>"
-                   "      <material name=\"black\"/>"
-                   "    </visual>"
-                   "  </link>"
-                   "  <link name=\"wheel_fl\">"
-                   "    <visual>"
-                   "      <geometry>"
-                   "        <box size=\"1.0 2.0 1.0\"/>"
-                   "      </geometry>"
-                   "      <material name=\"black\"/>"
-                   "    </visual>"
-                   "  </link>"
-                   "  <link name=\"wheel_fr\">"
-                   "    <visual>"
-                   "      <geometry>"
-                   "        <box size=\"1.0 2.0 1.0\"/>"
-                   "      </geometry>"
-                   "      <material name=\"black\"/>"
-                   "    </visual>"
-                   "  </link>"
-                   "  <link name=\"head\">"
-                   "    <visual>"
-                   "      <geometry>"
-                   "        <box size=\"1.0 2.0 1.0\"/>"
-                   "      </geometry>"
-                   "      <material name=\"black\"/>"
-                   "    </visual>"
-                   "  </link>"
-                   "  <link name=\"camera_link\">"
-                   "    <visual>"
-                   "      <geometry>"
-                   "        <box size=\"1.0 2.0 1.0\"/>"
-                   "      </geometry>"
-                   "      <material name=\"black\"/>"
-                   "    </visual>"
-                   "  </link>"
-                   // Joints
-                   "  <joint name=\"base_link_to_wheel_bl\" type=\"continuous\">"
-                   "    <parent link=\"base_link\"/>"
-                   "    <child link=\"wheel_bl\"/>"
-                   "    <origin xyz=\"-0.5 -0.25 0.0\" rpy=\"0 0 0\"/>"
-                   "    <axis xyz=\"0 0 1\"/>"
-                   "  </joint>"
-                   "  <joint name=\"base_link_to_wheel_br\" type=\"continuous\">"
-                   "    <parent link=\"base_link\"/>"
-                   "    <child link=\"wheel_br\"/>"
-                   "    <origin xyz=\"-0.5 0.25 0.0\" rpy=\"0 0 0\"/>"
-                   "    <axis xyz=\"0 0 1\"/>"
-                   "  </joint>"
-                   "  <joint name=\"base_link_to_wheel_fl\" type=\"continuous\">"
-                   "    <parent link=\"base_link\"/>"
-                   "    <child link=\"wheel_fl\"/>"
-                   "    <origin xyz=\"0.5 -0.25 0.0\" rpy=\"0 0 0\"/>"
-                   "    <axis xyz=\"0 0 1\"/>"
-                   "  </joint>"
-                   "  <joint name=\"base_link_to_wheel_fr\" type=\"continuous\">"
-                   "    <parent link=\"base_link\"/>"
-                   "    <child link=\"wheel_fr\"/>"
-                   "    <origin xyz=\"0.5 0.25 0.0\" rpy=\"0 0 0\"/>"
-                   "    <axis xyz=\"0 0 1\"/>"
-                   "  </joint>"
-                   "  <joint name=\"base_link_to_head\" type=\"continuous\">"
-                   "    <parent link=\"base_link\"/>"
-                   "    <child link=\"head\"/>"
-                   "    <origin xyz=\"0.0 0.0 0.5\" rpy=\"0 0 0\"/>"
-                   "    <axis xyz=\"0 0 1\"/>"
-                   "  </joint>"
-                   "  <joint name=\"head_to_camera_link\" type=\"continuous\">"
-                   "    <parent link=\"head\"/>"
-                   "    <child link=\"camera_link\"/>"
-                   "    <origin xyz=\"0.5 0.25 0.0\" rpy=\"0 0 0\"/>"
-                   "    <axis xyz=\"0 0 1\"/>"
-                   "  </joint>"
-                   "</robot>";
-        }
-
-        void PrintFbxContent(const AZStd::string& str)
-        {
-            std::cout << __func__ << " fbx data:"
-                      << "\n---------------\n"
-                      << str.data() << "\n---------------\n";
-        }
-    };
-
-    TEST_F(UrdfToFbxConverterTest, ConvertUrdfWithOneLink)
-    {
-        const auto urdfStr = GetUrdfWithOneLink();
-
-        // Save generated FBX to file (it's then loaded by Asset Processor).
-        // TODO: remove temporary hardcoded path
-        AZStd::string projectPath = "/home/user/o3de/Ros2WarehouseDemo/one_link.fbx";
-
-        ROS2::UrdfToFbxConverter converter;
-        const auto fbxStr = converter.ConvertAndSaveToFile(urdfStr, projectPath);
-
-        PrintFbxContent(fbxStr);
-
-        // TODO: validation
-    }
-
-    TEST_F(UrdfToFbxConverterTest, ConvertUrdfWithTwoLinksAndJoint)
-    {
-        const auto urdfStr = GetUrdfWithTwoLinksAndOneJoint();
-
-        // Save generated FBX to file (it's then loaded by Asset Processor).
-        // TODO: remove temporary hardcoded path
-        AZStd::string projectPath = "/home/user/o3de/Ros2WarehouseDemo/two_links_one_joint.fbx";
-
-        ROS2::UrdfToFbxConverter converter;
-        const auto fbxStr = converter.ConvertAndSaveToFile(urdfStr, projectPath);
-
-        PrintFbxContent(fbxStr);
-
-        // TODO: validation
-    }
-
-    TEST_F(UrdfToFbxConverterTest, ConvertSimpleRobotUrdf)
-    {
-        const auto urdfStr = GetSimpleRobotUrdf();
-
-        ROS2::UrdfToFbxConverter converter;
-        const auto fbxStr = converter.Convert(urdfStr);
-
-        PrintFbxContent(fbxStr);
-
-        // TODO: validation
-    }
-
-} // namespace UnitTest

+ 0 - 7
Gems/ROS2/Code/ros2_files.cmake

@@ -66,13 +66,6 @@ set(FILES
         Source/RobotImporter/Utils/TypeConversions.cpp
         Source/RobotImporter/Utils/TypeConversions.cpp
         Source/RobotImporter/URDF/UrdfParser.cpp
         Source/RobotImporter/URDF/UrdfParser.cpp
         Source/RobotImporter/URDF/UrdfParser.h
         Source/RobotImporter/URDF/UrdfParser.h
-        Source/Converters/URDF/ToFBX/FbxGenerator.cpp
-        Source/Converters/URDF/ToFBX/FbxGenerator.h
-        Source/Converters/URDF/ToFBX/FbxNode.cpp
-        Source/Converters/URDF/ToFBX/FbxNode.h
-        Source/Converters/URDF/ToFBX/UniqueIdGenerator.h
-        Source/Converters/URDF/ToFBX/UrdfToFbxConverter.cpp
-        Source/Converters/URDF/ToFBX/UrdfToFbxConverter.h
         Source/VehicleDynamics/DriveModels/PidConfiguration.cpp
         Source/VehicleDynamics/DriveModels/PidConfiguration.cpp
         Source/VehicleDynamics/DriveModels/AckermannDriveModel.cpp
         Source/VehicleDynamics/DriveModels/AckermannDriveModel.cpp
         Source/VehicleDynamics/DriveModels/AckermannDriveModel.h
         Source/VehicleDynamics/DriveModels/AckermannDriveModel.h

+ 0 - 2
Gems/ROS2/Code/ros2_tests_files.cmake

@@ -6,7 +6,5 @@
 set(FILES
 set(FILES
     Tests/ROS2Test.cpp
     Tests/ROS2Test.cpp
     Tests/UrdfParserTest.cpp
     Tests/UrdfParserTest.cpp
-    Tests/FbxGeneratorTest.cpp
     Tests/GNSSTest.cpp
     Tests/GNSSTest.cpp
-    Tests/UrdfToFbxConverterTest.cpp
 )
 )