mtconnect / cppagent

C++ Agent toolkit - Pre-built binaries, visit: https://github.com/mtconnect/cppagent/releases Docker images available at https://hub.docker.com/repositories/mtconnect
http://mtcup.org/
Apache License 2.0
141 stars 91 forks source link

Guidance for making Custom adaptor #160

Closed GauravChoube closed 2 years ago

GauravChoube commented 3 years ago

Hi Everyone, I was working on MTconnect standard and its implementation for robot arm since a month. I have successfully executed given demo with existing dummy simulator and got much clarity about MTConnect standard but many still uncleared to me.

My Question is I want to design the custom adapter for robot arm where robot arm working on ROS and has interface level api to get parameter/data. Im planning to used Python based adapter method.

Following are some snap from machin/device

"""
### <intera_interface.camera.Cameras object at 0x7f7000ebd1d0>
returning list of cameras.
returning list of cameras.
<intera_interface.camera.Cameras object at 0x7f7000ebd1d0>
['head_camera', 'right_hand_camera']
returning status of camera node status
returning status of cameras.
<intera_interface.camera.Cameras object at 0x7f7000ebd1d0>
[{'head_camera': False}]
returning list of joint angles.
<intera_interface.limb.Limb object at 0x7f7000e9eb50>
{'right_j6': 0.03757280303404631, 'right_j5': -0.14348863013111313, 'right_j4': -0.021527025188471605, 'right_j3': 0.07550594407783962, 'right_j2': 0.383887433410508, 'right_j1': 1.4973033411209427, 'right_j0': -0.2712327814285942}
returning list of joint velocities.
<intera_interface.limb.Limb object at 0x7f7000e9eb50>
{'right_j6': -1.929568010892953, 'right_j5': -1.0907354541583965, 'right_j4': 1.1216723679506302, 'right_j3': 0.39001268738455713, 'right_j2': -0.27084490389136906, 'right_j1': -0.00488189762272742, 'right_j0': 0.025645913537435464}
returning list of joint efforts.
<intera_interface.limb.Limb object at 0x7f7000e9eb50>
{'right_j6': -7.771201257436926, 'right_j5': -5.5071351859812205, 'right_j4': 8.970128236161207, 'right_j3': 19.547099690477566, 'right_j2': -8.559692935425138, 'right_j1': -0.1261951409183896, 'right_j0': 0.6475421126202011}
<type 'dict'>
returning robot state.
<intera_interface.robot_enable.RobotEnable object at 0x7f7000e9ea10>
homed: True
ready: True
enabled: True
stopped: False
error: False
lowVoltage: False
estop_button: 0
estop_source: 0
<class 'intera_core_msgs.msg._RobotAssemblyState.RobotAssemblyState'>
"""

I have read all documents and related stuff but there is not much info for designing adapter ,specially how convert the Machin data into MT Connect Standard vocabulary. From above the snap, i got angles,velocity and effort. How to convert into Linear and rotatory format as Linear require X,Y,Z axis information.

Please guide me and help to resolve the my problem.

Thanks & Regards Gaurav Choubey

MRIIOT commented 3 years ago

@GauravChoube

Adapter:

Agent:

native:

right_j0: -0.2712327814285942
error: False
estop_button: 0

shdr:

2009-06-15T00:00:00.000000|right_j0|-0.2712327814285942

2009-06-15T00:00:00.000000|estop_button|ARMED
2009-06-15T00:00:00.000000|estop_button|TRIGGERED

2014-09-29T23:59:33.460470Z|error|NORMAL||||
2014-09-29T23:59:33.460470Z|error|FAULT||||

model:

<?xml version="1.0" encoding="UTF-8"?>
<MTConnectDevices xmlns:m="urn:mtconnect.org:MTConnectDevices:1.7"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns="urn:mtconnect.org:MTConnectDevices:1.7" xsi:schemaLocation="urn:mtconnect.org:MTConnectDevices:1.7 http://www.mtconnect.org/schemas/MTConnectDevices_1.7.xsd">
  <Header creationTime="2021-02-23T18:44:40+00:00" sender="localhost" instanceId="12345678" bufferSize="131072" version="1.7.0.3"/>
  <Devices>
    <Device id="robot" name="robot" uuid="0000" sampleInterval="10">
      <DataItems>
        <DataItem id="avail" category="EVENT" type="AVAILABILITY"/>
        <DataItem id="asset_changed" category="EVENT" type="ASSET_CHANGED"/>
        <DataItem id="asset_removed" category="EVENT" type="ASSET_REMOVED"/>
      </DataItems>
      <Components>
        <Controller id="controller">
          <DataItems>
            <DataItem id="estop_button" category="EVENT" type="EMERGENCY_STOP"/>
            <DataItem id="error" category="CONDITION" type="SYSTEM"/>
            <DataItem id="right_j0" category="SAMPLE" type="VELOCITY"/>
          </DataItems>
        </Controller>
      </Components>
    </Device>
  </Devices>
</MTConnectDevices>
wsobel commented 2 years ago

Are there issues. Robot "Joint" support was added to 1.7 using rotary axes. I'll close this unless you are still looking for help.