Welcome! Log In Create A New Profile

Advanced

How to add other device which is not supported now

Posted by nakamura_ml 
How to add other device which is not supported now
September 26, 2021 09:48PM
Hello,

is there a way to add other device in monkey logic?

I want to replace joystick(2D) which is connected via DAQ to robotic arm(3D).

joystick via DAQ can be replaced by USB joystick, so i think that it can be done
by replicate the code of USB joystick and modify the data acquisition code to my device one
Re: How to add other device which is not supported now
September 27, 2021 07:45AM
I do not understand how the joystick, robotic arm and NIMH ML are connected in your system. Please explain more.
Re: How to add other device which is not supported now
September 27, 2021 09:18PM
I am a newbie in monkey logic software.
so I'm sorry if I misunderstood.

My colleague uses a joystick that is connected via a usb NIDAQ board.
I want to replace it to robot arm system.

Robot arm is connected to PC via USB and send its end-effector's position(xyz) and rotation (3axis) at 1 kHz.
Software(written by c language) calculate the force feedback from these signals and then translate it to screen cursor position(xy)

I searched the way to communicate with matlab session and found matlab engine API.
so, i plan to send calculated screen cursor position to ring buffer in matlab workspace and then
read this buffer by evalin function from monkey logic software
Re: How to add other device which is not supported now
September 28, 2021 08:00AM
If you can reprogram the robot arm software, the easiest way is to make it convert screen cursor positions to voltage signals and then feed the voltage signals to NIMH ML.
Re: How to add other device which is not supported now
September 28, 2021 10:42PM
it may be easy about monkeylogic software, but its too complicate about hardware system.

I read the source code of NIMH_MonkeyLogic_2.2.

I think that data from device is loaded by getsample method in mldaq class,
and actual sampling codes for each device are defined in each DAQ class (pointingdevice.m, eyetracker.m, etc)

if i code for robot arm device, do i need to write the pointingdevice-like class?
Re: How to add other device which is not supported now
September 29, 2021 12:55AM
You are not aware that my DAQ toolbox is written in C++ and the scripts you mentioned are just wrappers, are you?
Re: How to add other device which is not supported now
September 29, 2021 04:04AM
I guess that the pointingdevice and eyetracker class is just the wrapper of mdqmex (only mex file, source code not included)
The getdata method of pointingdevice class use mdqmex function to get data and then convert it to xy.

But i coundn't find the information about mdqmex function.

What is the role of mdqmex?
If i ignore it and replace it to new method that get data from robot arm software, will it cause the problem?
Re: How to add other device which is not supported now
September 29, 2021 07:45AM
I already gave you the best solution that you can carry out in the current situation. It is up to you if you want to find it out in the hard way why it is the best, but you should do the homework yourself. I do not have time to explain how my code works.
Re: How to add other device which is not supported now
October 19, 2021 11:53AM
Now there is another option available. You can interface the robot arm with UDP or TCP via Ethernet.
https://monkeylogic.nimh.nih.gov/docs_NetworkedEyeJoy.html

The National Institute of Mental Health (NIMH) is part of the National Institutes of Health (NIH), a component of the U.S. Department of Health and Human Services.