Skip to content

User_App_NoROS_AnimateRobotModelInUnity3D

Mehmet Emre Çakal edited this page Oct 10, 2024 · 3 revisions

3.3 Animate a Robot Model in Unity

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:

  1. You can follow this video's second part for this example.

  2. Add the script JoyAxisJointTransformWriter to a GameObject containing a joint that you want to control and set a positive maximum velocity value.

  3. 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 or Vertical or define your own Input Axes.

  4. Use Edit > Project Settings > Input to view and modify your Input Axes. See Unity - Manual: Input for help.

Input Manager


© Siemens AG, 2017-2024

Clone this wiki locally