-
Notifications
You must be signed in to change notification settings - Fork 370
User_App_NoROS_AnimateRobotModelInUnity3D
Note: This tutorial assumes that you have completed tutorials:
You can move a joint of a URDF model with the following two scripts:
-
JoyAxisInputPasser: This script passes the value of a Unity Input Axis to a
JoyAxisWriter
class. -
JoyAxisJointTransformWriter: This class applies the value it receives via
Write(float value)
to move the Transform according to the degrees of freedom of the attached Joint.
Both scripts are located at the following path in your Unity Package: com.siemens.ros-sharp/Runtime/RosBridgeClient/MessageHandling
In your Unity Scene containing the URDF model, now do the following:
-
You can follow this video's second part for this example.
-
Add the script JoyAxisJointTransformWriter to a GameObject containing a joint that you want to control and set a positive maximum velocity value.
-
Add the script JoyAxisInputPasser to the same GameObject and specify the name of the Input Axis, with which you want to control the joint. You can use pre-defined axis names as
Horizontal
orVertical
or define your own Input Axes. -
Use
Edit
>Project Settings
>Input
to view and modify your Input Axes. See Unity - Manual: Input for help.
- As an alternative to JoyAxisJointTransformWriter you can use JoyAxisJointMotorWriter to control the joint motor speed instead of moving the transform.
© Siemens AG, 2017-2024
-
- 1.3.1 R2D2 Setup
- 1.3.2 Gazebo Setup on VM
- 1.3.3 TurtleBot Setup (Optional for ROS2)
-
- 2.1 Quick Start
- 2.2 Transfer a URDF from ROS to Unity
- 2.3 Transfer a URDF from Unity to ROS
- 2.4 Unity Simulation Scene Example
- 2.5 Gazebo Simulation Scene Example
- 2.6 Fibonacci Action Client
- 2.7 Fibonacci Action Server
- 3.1 Import a URDF on Windows
- 3.2 Create, Modify and Export a URDF Model
- 3.3 Animate a Robot Model in Unity
- Message Handling: Readers & Writers
- Thread Safety for Message Reception
- File Server Package
- ROS-Unity Coordinate System Conversions
- Post Build Events
- Preprocessor Directives in ROS#
- Adding New Message Types
- RosBridgeClient Protocols
- RosBridgeClient Serializers
- Action Server State Machine Model
© Siemens AG, 2017-2024