浏览代码

Adding Ros2 instructions, restructuring a little

/laurie-Ros2Update
LaurieCheers 3 年前
当前提交
024ec3ed
共有 31 个文件被更改,包括 405 次插入36 次删除
  1. 13
      tutorials/ros_unity_integration/network.md
  2. 26
      tutorials/ros_unity_integration/publisher.md
  3. 8
      tutorials/ros_unity_integration/service.md
  4. 20
      tutorials/ros_unity_integration/setup.md
  5. 29
      tutorials/ros_unity_integration/subscriber.md
  6. 2
      tutorials/ros_unity_integration/unity_scripts/RosPublisherExample.cs
  7. 8
      tutorials/ros_unity_integration/unity_scripts/RosServiceExample.cs
  8. 2
      tutorials/ros_unity_integration/unity_scripts/RosSubscriberExample.cs
  9. 6
      tutorials/ros_unity_integration/unity_scripts/RosUnityServiceExample.cs
  10. 6
      tutorials/ros_unity_integration/unity_service.md
  11. 32
      tutorials/ros_unity_integration/ros_packages/robotics_demo/scripts/color_publisher.py
  12. 32
      tutorials/ros_unity_integration/ros_packages/robotics_demo/scripts/object_pose_client.py
  13. 27
      tutorials/ros_unity_integration/ros_packages/robotics_demo/scripts/position_service.py
  14. 45
      tutorials/ros_unity_integration/ros2_packages/robotics_demo/CMakeLists.txt
  15. 19
      tutorials/ros_unity_integration/ros2_packages/robotics_demo/launch/robo_demo.launch
  16. 7
      tutorials/ros_unity_integration/ros2_packages/robotics_demo/msg/PosRot.msg
  17. 4
      tutorials/ros_unity_integration/ros2_packages/robotics_demo/msg/UnityColor.msg
  18. 31
      tutorials/ros_unity_integration/ros2_packages/robotics_demo/package.xml
  19. 32
      tutorials/ros_unity_integration/ros2_packages/robotics_demo/scripts/color_publisher.py
  20. 32
      tutorials/ros_unity_integration/ros2_packages/robotics_demo/scripts/object_pose_client.py
  21. 27
      tutorials/ros_unity_integration/ros2_packages/robotics_demo/scripts/position_service.py
  22. 27
      tutorials/ros_unity_integration/ros2_packages/robotics_demo/scripts/server_endpoint.py
  23. 3
      tutorials/ros_unity_integration/ros2_packages/robotics_demo/srv/ObjectPoseService.srv
  24. 3
      tutorials/ros_unity_integration/ros2_packages/robotics_demo/srv/PositionService.srv
  25. 0
      /tutorials/ros_unity_integration/ros_packages

13
tutorials/ros_unity_integration/network.md


`ROS_IP` : The IP address of the machine, VM, or container running ROS.
`UNITY_IP` : The IP address of the machine running Unity.
> It is possible to set both of these variables on the machines running Unity and ROS. The specifics of where and why each of these settings will be described below.
On the ROS machine these settings are set as a rosparam and will typically be set in a launch file like [this](https://github.com/Unity-Technologies/Unity-Robotics-Hub/blob/main/tutorials/ros_packages/robotics_demo/launch/robo_demo.launch) or in a [param file](https://github.com/Unity-Technologies/Unity-Robotics-Hub/blob/main/tutorials/pick_and_place/ROS/src/niryo_moveit/config/params.yaml) loaded by a launch file like [this](https://github.com/Unity-Technologies/Unity-Robotics-Hub/blob/main/tutorials/pick_and_place/ROS/src/niryo_moveit/launch/part_3.launch#L2). The param file can also be loaded manually by running the `rosparam load params.yaml` command.

- On the ROS side, set `ROS_IP` to `0.0.0.0`.
- On the Unity side, set `ROS_IP` to `127.0.0.1` and the `Override Unity IP Address` to your local machine's IP address.
- On the Unity side, set `ROS_IP` to `127.0.0.1`.
## Explicitly setting `UNITY_IP`
The `UNITY_IP` can be set in two different places.
1. If set on the ROS side as a rosparam, the `server_endpoint` will only use this IP to send messages to Unity.
1. If set on the Unity side as the `Override Unity IP Address`, the `UNITY_IP` on the ROS side will be set to this value during the initial handshake between ROS and Unity once play is pressed in the Editor.
> If the `UNITY_IP` is not set in either of these places, then the IP that makes the first connection to ROS during the initial handshake will be used.
# Troubleshooting

26
tutorials/ros_unity_integration/publisher.md


## Setting Up ROS
- Copy the `tutorials/ros_packages/robotics_demo` folder of this repo into the `src` folder in your Catkin workspace.
- If using ROS (melodic or noetic), copy the `tutorials/ros_packages/robotics_demo` folder of this repo into the `src` folder in your Catkin workspace.
- Follow the [ROS–Unity Initial Setup](setup.md) guide.

rostopic echo pos_rot
```
## Setting Up ROS2
- If using ROS2, copy the `tutorials/ros2_packages/robotics_demo` folder of this repo into the `src` folder in your Colcon workspace.
- Follow the [ROS–Unity Initial Setup](setup.md) guide.
- Open a new terminal window and run the following commands:
```bash
source install/setup.bash
ros2 run robotics_demo server_endpoint.py
```
Once the server_endpoint has started, it will print something similar to `[INFO] [1603488341.950794]: Starting server on 192.168.50.149:10000`.
- Open another new terminal window, navigate to your ROS workspace, and run the following commands:
```bash
source install/setup.bash
ros2 topic echo pos_rot
```
## Setting Up Unity Scene
- In the menu bar, find and select `Robotics` -> `Generate ROS Messages...`
- Set the ROS message path to `PATH/TO/Unity-Robotics-Hub/tutorials/ros_packages/robotics_demo`.

{
cube.transform.rotation = Random.rotation;
MPosRot cubePos = new MPosRot(
PosRotMsg cubePos = new PosRotMsg(
cube.transform.position.x,
cube.transform.position.y,
cube.transform.position.z,

- Move the cube a little ways up so it is hovering above the plane
- In the main menu bar, open `Robotics/ROS Settings`.
- Set the ROS IP address and port to match the ROS IP and port variables defined when you set up ROS.
- If using ROS2, switch to the ROS2 protocol.
- Create another empty GameObject, name it `RosPublisher` and attach the `RosPublisherExample` script.
- Drag the cube GameObject onto the `Cube` parameter.

8
tutorials/ros_unity_integration/service.md


{
Debug.Log("Destination reached.");
MPosRot cubePos = new MPosRot(
PosRotMsg cubePos = new PosRotMsg(
cube.transform.position.x,
cube.transform.position.y,
cube.transform.position.z,

cube.transform.rotation.w
);
MPositionServiceRequest positionServiceRequest = new MPositionServiceRequest(cubePos);
PositionServiceRequest positionServiceRequest = new PositionServiceRequest(cubePos);
ros.SendServiceMessage<MPositionServiceResponse>(serviceName, positionServiceRequest, Callback_Destination);
ros.SendServiceMessage<PositionServiceResponse>(serviceName, positionServiceRequest, Callback_Destination);
void Callback_Destination(MPositionServiceResponse response)
void Callback_Destination(PositionServiceResponse response)
{
awaitingResponseUntilTimestamp = -1;
destination = new Vector3(response.output.pos_x, response.output.pos_y, response.output.pos_z);

20
tutorials/ros_unity_integration/setup.md


## ROS Environment
1. Follow these steps if using ROS (melodic or noetic):
1. Download and copy the [TCP Endpoint](https://github.com/Unity-Technologies/ROS-TCP-Endpoint) package to the `src` folder in your Catkin workspace.
1. Navigate to your Catkin workspace and run `catkin_make && source devel/setup.bash`. Ensure there are no errors.

Once ROS Core has started, it will print `started core service [/rosout]` to the terminal window.
1. Note that in the `server_endpoint`, the script fetches parameters for the TCP connection. You will need to know the IP address of your ROS machine as well as the IP address of the machine running Unity.
- The ROS machine IP, i.e. `ROS_IP` should be the same value as the one set as `Host Name` on the RosConnect component in Unity.
1. Note that in the `server_endpoint`, the script fetches parameters for the TCP connection. You will need to know the IP address of your ROS machine, which should be the same value as the one set as `Host Name` on the RosConnect component in Unity.
1. The ROS parameter values can be set using a YAML file. Create a `params.yaml` file in your package, e.g. `./config/params.yaml`. Open the file for editing.
1. Update the `ROS_IP` below with the appropriate address and copy the contents into the `params.yaml` file.

>
> Read more about the ROS Parameter Server [here](http://wiki.ros.org/Parameter%20Server).
## ROS2 Environment
1. Follow these steps if using ROS2:
1. Download the [ROS2 TCP Endpoint](https://github.com/Unity-Technologies/ROS2-TCP-Endpoint) repository and copy the folders `ROS2_packages/ros2_tcp_endpoint` and `ROS2_packages/unity_interfaces` into the `src` folder in your Colcon workspace.
1. Navigate to your Colcon workspace and run `colcon build && source install/setup.bash`. Ensure there are no errors.
1. Note that in the `server_endpoint`, the script fetches parameters for the TCP connection. You will need to know the IP address of your ROS2 machine - this should be the same value as the one set as `Host Name` on the RosConnect component in Unity.
## Unity Scene
1. Launch Unity and create a new scene.
2. Open Package Manager and click the + button at the top left corner. Select "add package from git URL" and enter "https://github.com/Unity-Technologies/ROS-TCP-Connector.git?path=/com.unity.robotics.ros-tcp-connector" to install the [ROS TCP Connector](https://github.com/Unity-Technologies/ROS-TCP-Connector) package.

![](images/add_package_2.png)
Messages being passed between Unity and ROS need to be serialized exactly as ROS serializes them internally. This is achieved with the RosMessageGeneration utility, which generates C# classes, including serialization and deserialization functions, based on ROS message files. Adding the ROS TCP Connector package should have created a new Unity menu option, “Robotics/Generate ROS Messages”, which we will use to generate these messages later.
![](images/add_package_2.png)

29
tutorials/ros_unity_integration/subscriber.md


- The generated files will be saved in the default directory `Assets/RosMessages/RoboticsDemo/msg`.
## Setting Up ROS2
(Skip to [Setting Up Unity Scene](subscriber.md#setting-up-unity-scene) if you already did the [Publisher](publisher.md) tutorial.)
- Copy the `tutorials/ros2_packages/robotics_demo` folder of this repo into the `src` folder in your Colcon workspace.
- Follow the [ROS–Unity Initial Setup](setup.md) guide.
- Open a new terminal window, navigate to your Colcon workspace, and run the following commands:
```bash
source install/setup.bash
ros2 run robotics_demo server_endpoint.py
```
Once the server_endpoint has started, it will print something similar to `[INFO] [1603488341.950794]: Starting server on 192.168.50.149:10000`.
- In Unity, we need to generate the C# code for the `UnityColor` message. Open `Robotics` -> `Generate ROS Messages...`.
- Set the ROS message path to `PATH/TO/Unity-Robotics-Hub/tutorials/ros_packages/robotics_demo/`, expand the robotics_demo subfolder and click `Build 2 msgs`.
![](images/generate_messages_1.png)
- The generated files will be saved in the default directory `Assets/RosMessages/RoboticsDemo/msg`.
## Setting Up Unity Scene
- Create a script and name it `RosSubscriberExample.cs`
- Paste the following code into `RosSubscriberExample.cs`

using UnityEngine;
using Unity.Robotics.ROSTCPConnector;
using RosColor = RosMessageTypes.RoboticsDemo.MUnityColor;
using RosColor = RosMessageTypes.RoboticsDemo.UnityColorMsg;
public class RosSubscriberExample : MonoBehaviour
{

- Attach the `RosSubscriberExample` script to the `RosSubscriber` GameObject and drag the cube GameObject onto the `cube` parameter in the Inspector window.
- From the Unity menu bar, open `Robotics/ROS Settings`, and set the `ROS IP Address` variable to your ROS IP.
- If using ROS2, also switch the protocol to ROS2.
- In ROS2, instead run `ros2 run robotics_demo color_publisher.py`.
> Please reference [networking troubleshooting](network.md) doc if any errors are thrown.

2
tutorials/ros_unity_integration/unity_scripts/RosPublisherExample.cs


{
cube.transform.rotation = Random.rotation;
MPosRot cubePos = new MPosRot(
PosRotMsg cubePos = new PosRotMsg(
cube.transform.position.x,
cube.transform.position.y,
cube.transform.position.z,

8
tutorials/ros_unity_integration/unity_scripts/RosServiceExample.cs


{
Debug.Log("Destination reached.");
MPosRot cubePos = new MPosRot(
PosRotMsg cubePos = new PosRotMsg(
cube.transform.position.x,
cube.transform.position.y,
cube.transform.position.z,

cube.transform.rotation.w
);
MPositionServiceRequest positionServiceRequest = new MPositionServiceRequest(cubePos);
PositionServiceRequest positionServiceRequest = new PositionServiceRequest(cubePos);
ros.SendServiceMessage<MPositionServiceResponse>(serviceName, positionServiceRequest, Callback_Destination);
ros.SendServiceMessage<PositionServiceResponse>(serviceName, positionServiceRequest, Callback_Destination);
void Callback_Destination(MPositionServiceResponse response)
void Callback_Destination(PositionServiceResponse response)
{
awaitingResponseUntilTimestamp = -1;
destination = new Vector3(response.output.pos_x, response.output.pos_y, response.output.pos_z);

2
tutorials/ros_unity_integration/unity_scripts/RosSubscriberExample.cs


using UnityEngine;
using Unity.Robotics.ROSTCPConnector;
using RosColor = RosMessageTypes.RoboticsDemo.MUnityColor;
using RosColor = RosMessageTypes.RoboticsDemo.UnityColorMsg;
public class RosSubscriberExample : MonoBehaviour
{

6
tutorials/ros_unity_integration/unity_scripts/RosUnityServiceExample.cs


void Start()
{
// register the service with ROS
ROSConnection.instance.ImplementService<MObjectPoseServiceRequest>(m_ServiceName, GetObjectPose);
ROSConnection.instance.ImplementService<ObjectPoseServiceRequest>(m_ServiceName, GetObjectPose);
}
/// <summary>

/// <returns>service response containing the object pose (or 0 if object not found)</returns>
private MObjectPoseServiceResponse GetObjectPose(MObjectPoseServiceRequest request)
private MObjectPoseServiceResponse GetObjectPose(ObjectPoseServiceRequest request)
MObjectPoseServiceResponse objectPoseResponse = new MObjectPoseServiceResponse();
ObjectPoseServiceResponse objectPoseResponse = new ObjectPoseServiceResponse();
// Find a game object with the requested name
GameObject gameObject = GameObject.Find(request.object_name);
if (gameObject)

6
tutorials/ros_unity_integration/unity_service.md


void Start()
{
// register the service with ROS
ROSConnection.instance.ImplementService<MObjectPoseServiceRequest>(m_ServiceName, GetObjectPose);
ROSConnection.instance.ImplementService<ObjectPoseServiceRequest>(m_ServiceName, GetObjectPose);
}
/// <summary>

/// <returns>service response containing the object pose (or 0 if object not found)</returns>
private MObjectPoseServiceResponse GetObjectPose(MObjectPoseServiceRequest request)
private ObjectPoseServiceResponse GetObjectPose(ObjectPoseServiceRequest request)
MObjectPoseServiceResponse objectPoseResponse = new MObjectPoseServiceResponse();
ObjectPoseServiceResponse objectPoseResponse = new ObjectPoseServiceResponse();
// Find a game object with the requested name
GameObject gameObject = GameObject.Find(request.object_name);
if (gameObject)

32
tutorials/ros_unity_integration/ros_packages/robotics_demo/scripts/color_publisher.py


#!/usr/bin/env python
import random
import rospy
from robotics_demo.msg import UnityColor
TOPIC_NAME = 'color'
NODE_NAME = 'color_publisher'
def post_color():
pub = rospy.Publisher(TOPIC_NAME, UnityColor, queue_size=10)
rospy.init_node(NODE_NAME, anonymous=True)
rate = rospy.Rate(10) # 10hz
while not rospy.is_shutdown():
r = random.randint(0, 255)
g = random.randint(0, 255)
b = random.randint(0, 255)
color = UnityColor(r, g, b, 1)
pub.publish(color)
rate.sleep()
break
if __name__ == '__main__':
try:
post_color()
except rospy.ROSInterruptException:
pass

32
tutorials/ros_unity_integration/ros_packages/robotics_demo/scripts/object_pose_client.py


#!/usr/bin/env python
from __future__ import print_function
import random
import rospy
import sys
from robotics_demo.srv import ObjectPoseService, ObjectPoseServiceResponse
def get_object_pose_client(name):
rospy.wait_for_service('obj_pose_srv')
try:
get_obj_pose = rospy.ServiceProxy('obj_pose_srv', ObjectPoseService)
obj_pose_resp = get_obj_pose(name)
return obj_pose_resp.object_pose
except rospy.ServiceException as e:
print("Service call failed: %s"%e)
def usage():
return "%s [object_name]"%sys.argv[0]
if __name__ == "__main__":
if len(sys.argv) == 2:
name = str(sys.argv[1])
else:
print(usage())
sys.exit(1)
print("Requesting pose for %s"%(name))
print("Pose for %s: %s"%(name, get_object_pose_client(name)))

27
tutorials/ros_unity_integration/ros_packages/robotics_demo/scripts/position_service.py


#!/usr/bin/env python
from __future__ import print_function
import random
import rospy
from robotics_demo.srv import PositionService, PositionServiceResponse
def new_position(req):
print("Request: \n{}".format(req.input))
req.input.pos_x = random.uniform(-4.0, 4.0)
req.input.pos_z = random.uniform(-4.0, 4.0)
return PositionServiceResponse(req.input)
def translate_position_server():
rospy.init_node('position_server')
s = rospy.Service('pos_srv', PositionService, new_position)
print("Ready to move cubes!")
rospy.spin()
if __name__ == "__main__":
translate_position_server()

45
tutorials/ros_unity_integration/ros2_packages/robotics_demo/CMakeLists.txt


cmake_minimum_required(VERSION 2.8.3)
project(robotics_demo)
find_package(catkin REQUIRED COMPONENTS
rospy
std_msgs
geometry_msgs
ros_tcp_endpoint
message_generation
)
add_message_files(DIRECTORY msg)
add_service_files(DIRECTORY srv)
generate_messages(
DEPENDENCIES
geometry_msgs
std_msgs
)
catkin_package(CATKIN_DEPENDS
ros_tcp_endpoint
message_runtime)
catkin_install_python(PROGRAMS
scripts/server_endpoint.py
scripts/position_service.py
scripts/color_publisher.py
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
#############
## Testing ##
#############
## Add gtest based cpp test target and link libraries
# catkin_add_gtest(${PROJECT_NAME}-test test/test_robotics_demo.cpp)
# if(TARGET ${PROJECT_NAME}-test)
# target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
# endif()
## Add folders to be run by python nosetests
# catkin_add_nosetests(test)

19
tutorials/ros_unity_integration/ros2_packages/robotics_demo/launch/robo_demo.launch


<launch>
<env name="ROS_IP" value="192.168.1.116"/>
<env name="ROS_HOSTNAME" value="$(env ROS_IP)"/>
<param name="ROS_IP" type="str" value="$(env ROS_IP)" />
<param name="ROS_TCP_PORT" type="int" value="10000" />
<param name="TCP_NODE_NAME" type="str" value="TCPServer" />
<param name="TCP_BUFFER_SIZE" type="int" value="1024" />
<param name="TCP_CONNECTIONS" type="int" value="10" />
<param name="UNITY_IP" type="str" value="192.168.1.105" />
<param name="UNITY_SERVER_PORT" type="int" value="5005" />
<group ns="position_service_and_endpoint">
<node pkg="robotics_demo" name="position_service" type="position_service.py"/>
<node pkg="robotics_demo" name="server_endpoint" type="server_endpoint.py"/>
</group>
</launch>

7
tutorials/ros_unity_integration/ros2_packages/robotics_demo/msg/PosRot.msg


float32 pos_x
float32 pos_y
float32 pos_z
float32 rot_x
float32 rot_y
float32 rot_z
float32 rot_w

4
tutorials/ros_unity_integration/ros2_packages/robotics_demo/msg/UnityColor.msg


int32 r
int32 g
int32 b
int32 a

31
tutorials/ros_unity_integration/ros2_packages/robotics_demo/package.xml


<?xml version="1.0"?>
<package format="2">
<name>robotics_demo</name>
<version>0.0.0</version>
<description>The robotics_demo package</description>
<maintainer email="unity-robotics@unity3d.com">Unity Robotics</maintainer>
<license>Apache 2.0</license>
<buildtool_depend>catkin</buildtool_depend>
<build_depend>rospy</build_depend>
<build_depend>message_generation</build_depend>
<build_depend>std_msgs</build_depend>
<build_depend>ros_tcp_endpoint</build_depend>
<build_export_depend>rospy</build_export_depend>
<build_export_depend>std_msgs</build_export_depend>
<build_export_depend>ros_tcp_endpoint</build_export_depend>
<exec_depend>message_runtime</exec_depend>
<exec_depend>rospy</exec_depend>
<exec_depend>std_msgs</exec_depend>
<exec_depend>ros_tcp_endpoint</exec_depend>
<!-- The export tag contains other, unspecified, tags -->
<export>
<!-- Other tools can request additional information be placed here -->
</export>
</package>

32
tutorials/ros_unity_integration/ros2_packages/robotics_demo/scripts/color_publisher.py


#!/usr/bin/env python
import random
import rospy
from robotics_demo.msg import UnityColor
TOPIC_NAME = 'color'
NODE_NAME = 'color_publisher'
def post_color():
pub = rospy.Publisher(TOPIC_NAME, UnityColor, queue_size=10)
rospy.init_node(NODE_NAME, anonymous=True)
rate = rospy.Rate(10) # 10hz
while not rospy.is_shutdown():
r = random.randint(0, 255)
g = random.randint(0, 255)
b = random.randint(0, 255)
color = UnityColor(r, g, b, 1)
pub.publish(color)
rate.sleep()
break
if __name__ == '__main__':
try:
post_color()
except rospy.ROSInterruptException:
pass

32
tutorials/ros_unity_integration/ros2_packages/robotics_demo/scripts/object_pose_client.py


#!/usr/bin/env python
from __future__ import print_function
import random
import rospy
import sys
from robotics_demo.srv import ObjectPoseService, ObjectPoseServiceResponse
def get_object_pose_client(name):
rospy.wait_for_service('obj_pose_srv')
try:
get_obj_pose = rospy.ServiceProxy('obj_pose_srv', ObjectPoseService)
obj_pose_resp = get_obj_pose(name)
return obj_pose_resp.object_pose
except rospy.ServiceException as e:
print("Service call failed: %s"%e)
def usage():
return "%s [object_name]"%sys.argv[0]
if __name__ == "__main__":
if len(sys.argv) == 2:
name = str(sys.argv[1])
else:
print(usage())
sys.exit(1)
print("Requesting pose for %s"%(name))
print("Pose for %s: %s"%(name, get_object_pose_client(name)))

27
tutorials/ros_unity_integration/ros2_packages/robotics_demo/scripts/position_service.py


#!/usr/bin/env python
from __future__ import print_function
import random
import rospy
from robotics_demo.srv import PositionService, PositionServiceResponse
def new_position(req):
print("Request: \n{}".format(req.input))
req.input.pos_x = random.uniform(-4.0, 4.0)
req.input.pos_z = random.uniform(-4.0, 4.0)
return PositionServiceResponse(req.input)
def translate_position_server():
rospy.init_node('position_server')
s = rospy.Service('pos_srv', PositionService, new_position)
print("Ready to move cubes!")
rospy.spin()
if __name__ == "__main__":
translate_position_server()

27
tutorials/ros_unity_integration/ros2_packages/robotics_demo/scripts/server_endpoint.py


#!/usr/bin/env python
import rospy
from ros_tcp_endpoint import TcpServer, RosPublisher, RosSubscriber, RosService, UnityService
from robotics_demo.msg import PosRot, UnityColor
from robotics_demo.srv import PositionService, ObjectPoseService
def main():
ros_node_name = rospy.get_param("/TCP_NODE_NAME", 'TCPServer')
buffer_size = rospy.get_param("/TCP_BUFFER_SIZE", 1024)
connections = rospy.get_param("/TCP_CONNECTIONS", 10)
tcp_server = TcpServer(ros_node_name, buffer_size, connections)
rospy.init_node(ros_node_name, anonymous=True)
tcp_server.start({
'pos_rot': RosPublisher('pos_rot', PosRot, queue_size=10),
'color': RosSubscriber('color', UnityColor, tcp_server),
'pos_srv': RosService('pos_srv', PositionService),
'obj_pose_srv': UnityService('obj_pose_srv', ObjectPoseService, tcp_server),
})
rospy.spin()
if __name__ == "__main__":
main()

3
tutorials/ros_unity_integration/ros2_packages/robotics_demo/srv/ObjectPoseService.srv


string object_name
---
geometry_msgs/Pose object_pose

3
tutorials/ros_unity_integration/ros2_packages/robotics_demo/srv/PositionService.srv


PosRot input
---
PosRot output

/tutorials/ros_packages → /tutorials/ros_unity_integration/ros_packages

正在加载...
取消
保存