浏览代码

Merge branch 'laurie/DemoCompileFix' into laurie/Visualizers

/laurie-Visualizers
LaurieCheers 4 年前
当前提交
3849ffe3
共有 5 个文件被更改,包括 35 次插入6 次删除
  1. 6
      faq.md
  2. 3
      tutorials/pick_and_place/PickAndPlaceProject/Assets/DemoScripts/Demo.cs
  3. 4
      tutorials/pick_and_place/ROS/src/niryo_moveit/scripts/mover.py
  4. 26
      tutorials/pick_and_place/ROS/src/niryo_moveit/scripts/server_endpoint.py
  5. 2
      tutorials/pick_and_place/Scripts/TrajectoryPlanner.cs

6
faq.md


---
We definitely plan to support ROS 2 in the future. Let us know more about your use case in order to prioritize our work by reaching out to us at [unity-robotics@unity3d.com](mailto:unity-robotics@unity3d.com).
How does your Unity integration compare to [ROS#](https://github.com/siemens/ros-sharp)?
How does your Unity integration compare to ROS#?
Two of the Unity Robotics repos (URDF Importer and TCP Connector) have been forked from the Siemens ROS# repo.
Two of the Unity Robotics repos (URDF Importer and TCP Connector) have been forked from the [Siemens ROS# repo](https://github.com/siemens/ros-sharp).
You can find more details about the differences between our implementation and ROS#, along with some of their future plans, in the [ROS# project](https://github.com/siemens/ros-sharp/wiki/Ext_RosSharp_RoboticsHub#differences-between-unity-robotics-hub-and-ros).
How can I install the Unity Packages without starting from a template project?
---

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


#if UNITY_EDITOR
using Microsoft.CSharp;
using RosMessageGeneration;
using RosSharp;
using RosSharp.Control;
using RosSharp.Urdf.Editor;

using System.Text;
using UnityEditor;
using UnityEngine;
using Unity.Robotics.ROSTCPConnector;
using Unity.Robotics.ROSTCPConnector.MessageGeneration;
public class Demo : MonoBehaviour
{

4
tutorials/pick_and_place/ROS/src/niryo_moveit/scripts/mover.py


move_group.set_start_state(moveit_robot_state)
move_group.set_pose_target(destination_pose)
plan = move_group.go(wait=True)
plan = move_group.plan()
if not plan:
exception_str = """

raise Exception(exception_str)
return planCompat(move_group.plan())
return planCompat(plan)
"""

26
tutorials/pick_and_place/ROS/src/niryo_moveit/scripts/server_endpoint.py


#!/usr/bin/env python
import rospy
from ros_tcp_endpoint import TcpServer, RosPublisher, RosSubscriber, RosService
from niryo_moveit.msg import NiryoMoveitJoints, NiryoTrajectory
from niryo_moveit.srv import MoverService
def main():
ros_node_name = rospy.get_param("/TCP_NODE_NAME", 'TCPServer')
tcp_server = TcpServer(ros_node_name)
rospy.init_node(ros_node_name, anonymous=True)
# Start the Server Endpoint with a ROS communication objects dictionary for routing messages
tcp_server.start({
'SourceDestination_input': RosPublisher('SourceDestination', NiryoMoveitJoints, queue_size=10),
'NiryoTrajectory': RosSubscriber('NiryoTrajectory', NiryoTrajectory, tcp_server),
'niryo_moveit': RosService('niryo_moveit', MoverService)
})
rospy.spin()
if __name__ == "__main__":
main()

2
tutorials/pick_and_place/Scripts/TrajectoryPlanner.cs


void TrajectoryResponse(MoverServiceResponse response)
{
if (response.trajectories != null)
if (response.trajectories.Length > 0)
{
Debug.Log("Trajectory returned.");
StartCoroutine(ExecuteTrajectories(response));

正在加载...
取消
保存