Problems with translate and orient the object in Isaac

Hi,

I am performing a hybrid simulation with Isaac and MotionsolveI by building data transfer with two programs. I have checked the data transfer couple times and everything is looking correct. I have no idea what is wrong in the Omniverse because the “animation” looks odd.

I have demonstrated the problem with the simple inverted pendulum mode.

This how things are looking in Isaac
omniverse

This how it should look like (Picture under)

Hyper

Here is my code

  def print_cube_info(self, step_size):
        import socket, struct
        UDP_IP = "127.0.0.1"
        UDP_PORT = 8888
        sock = socket.socket(socket.AF_INET, # Interne
                             socket.SOCK_DGRAM) # UDP

        sock.bind((UDP_IP, UDP_PORT))

        timeline = omni.timeline.get_timeline_interface()
        timecode = timeline.get_current_time() * timeline.get_time_codes_per_seconds()

        data, addr = sock.recvfrom(1048)
        
        value = struct.unpack('f'*7, data)
        print(value)
        self._world = self.get_world()
        #component = "/World/testi/testi2/rod/rod"
        boxes = XFormPrimView(component)
        position, orientation = boxes.get_world_poses()
        #linear_velocity = self._cube.get_linear_velocity()
        # will be shown on terminal
        #print("Cube position is : " + str(position))
        #print("Cube's orientation is : " + str(orientation))
        #print("Cube's linear velocity is : " + str(linear_velocity))

        fix = 57.2957795
        #checked
        rotatationNew = [value[3]*fix,value[4]*fix,value[5]*fix]
        #checked
        translationNew = [value[0],value[1],value[2]]
        file = open("D:/Projektit/Digital twin/pendelum_inverse_Run/demofile2.txt", "a")
        message = str(value[0])+","+str(value[1])+","+str(value[2])+","+str(value[3])+","+str(value[4])+","+str(value[5])+"\n"
        file.write(message) 
        file.close()
        omni.kit.commands.execute('TransformMultiPrimsSRTCpp',
                                  count=1,
                                  paths=[component],
                                  new_translations=translationNew,
                                  new_rotation_eulers=rotatationNew,
                                  new_rotation_orders=[0, 1, 2],
                                  new_scales=[1.0, 1.0, 1.0],
                                  old_translations=position,
                                  old_rotation_eulers=orientation,
                                  old_rotation_orders=[0, 1, 2],
                                  old_scales=[1.0, 1.0, 1.0],
                                  usd_context_name='',
                                  time_code=timeline)

        sock.close()

Basically I want that the other program calculates the translations and rotations. Omniverse uses them and do own simulations ( not in this inverted pendulum model)

Thanks & cheers,

Petri

Hi @petri.seppanen - Someone from our team will review and respond to your questions.

Hi! upon quick inspection I believe the issue may be that it’s double-assigning the transform to the assets. at some point in your asset you have an Transform XformOP, that is not changing, and you have the Translate, Orient, Scale OPs in the top. Since they compound, this may be one reason why it’s so dramatic in Isaac Sim. I’d try to fix either the model to use Translate, Orient and Scale, or the connector to apply the transform instead.

image

Thanks for you help. I have found the reasons for the problems. And those are following:
1: Unit problem. → Need to check that programs are using the same units or scale the movement in Omniverse
2: I need modify the data from Motionview. The data from Motionview tell the location of the cg of the part. I need convert it into the change of location of the cg of the part

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.