浏览代码

Update Demo (#235)

* Update Demo

* Minor fix

* Update tutorial manifest to use v0.4.0

* Update ros_tcp_endpoint module

* Update quick_setup version

* Update tutorial manifest
/merge-resolve-conflicts
peifeng-unity 3 年前
当前提交
a3f78573
共有 3 个文件被更改,包括 9 次插入13 次删除
  1. 15
      tutorials/pick_and_place/PickAndPlaceProject/Assets/DemoScripts/Demo.cs
  2. 5
      tutorials/pick_and_place/PickAndPlaceProject/Packages/manifest.json
  3. 2
      tutorials/quick_setup.md

15
tutorials/pick_and_place/PickAndPlaceProject/Assets/DemoScripts/Demo.cs


using System.Text;
using RosSharp;
using RosSharp.Control;
using RosSharp.Urdf;
using RosSharp.Urdf.Editor;
using UnityEditor;
using UnityEngine;

// Create RosConnect
GameObject rosConnect = new GameObject(rosConnectName);
rosConnection = rosConnect.AddComponent<ROSConnection>();
rosConnection.rosIPAddress = hostIP;
rosConnection.rosPort = hostPort;
rosConnection.overrideUnityIP = overrideUnityIP;
rosConnection.unityPort = unityPort;
rosConnection.awaitDataMaxRetries = awaitDataMaxRetries;
rosConnection.awaitDataSleepSeconds = awaitDataSleepSeconds;
rosConnection.RosIPAddress = hostIP;
rosConnection.RosPort = hostPort;
}
private void ImportRobot()

string urdfFilepath = Path.Combine(Application.dataPath, urdfRelativeFilepath);
// Create is a coroutine that would usually run only in EditMode, so we need to force its execution here
var robotImporter = UrdfRobotExtensions.Create(urdfFilepath, urdfImportSettings, false);
while (robotImporter.MoveNext()) {}
while (robotImporter.MoveNext()) { }
// Adjust robot parameters
Controller controller = GameObject.Find(niryoOneName).GetComponent<Controller>();
controller.stiffness = controllerStiffness;

parameters.GenerateExecutable = false;
string[] texts = new string[filepaths.Length];
for (int i = 0; i < filepaths.Length; i ++)
for (int i = 0; i < filepaths.Length; i++)
texts[i] = File.ReadAllText(filepaths[i]);
texts[i] = File.ReadAllText(filepaths[i]);
}
CompilerResults results = provider.CompileAssemblyFromSource(parameters, texts);
checkCompileErrors(results);

5
tutorials/pick_and_place/PickAndPlaceProject/Packages/manifest.json


"com.unity.ide.rider": "2.0.7",
"com.unity.ide.visualstudio": "2.0.3",
"com.unity.ide.vscode": "1.2.2",
"com.unity.robotics.ros-tcp-connector":
"https://github.com/Unity-Technologies/ROS-TCP-Connector.git?path=/com.unity.robotics.ros-tcp-connector#v0.3.0",
"com.unity.robotics.urdf-importer": "https://github.com/Unity-Technologies/URDF-Importer.git?path=/com.unity.robotics.urdf-importer#v0.3.0",
"com.unity.robotics.ros-tcp-connector": "https://github.com/Unity-Technologies/ROS-TCP-Connector.git?path=/com.unity.robotics.ros-tcp-connector#v0.4.0",
"com.unity.robotics.urdf-importer": "https://github.com/Unity-Technologies/URDF-Importer.git?path=/com.unity.robotics.urdf-importer#v0.4.0",
"com.unity.test-framework": "1.1.18",
"com.unity.textmeshpro": "3.0.1",
"com.unity.timeline": "1.4.3",

2
tutorials/quick_setup.md


![](../images/packman.png)
1. Enter the git URL for the desired package. Note: you can append a version tag to the end of the git url, like `#v0.2.0` or `#v0.3.0`, to declare a specific package version, or exclude the tag to get the latest from the package's `main` branch.
1. Enter the git URL for the desired package. Note: you can append a version tag to the end of the git url, like `#v0.3.0` or `#v0.4.0`, to declare a specific package version, or exclude the tag to get the latest from the package's `main` branch.
1. For the [ROS-TCP-Connector](https://github.com/Unity-Technologies/ROS-TCP-Connector), enter `https://github.com/Unity-Technologies/ROS-TCP-Connector.git?path=/com.unity.robotics.ros-tcp-connector`.
1. For the [URDF-Importer](https://github.com/Unity-Technologies/URDF-Importer), enter `https://github.com/Unity-Technologies/URDF-Importer.git?path=/com.unity.robotics.urdf-importer`.

正在加载...
取消
保存