Kinarm | Interactive Robotics Brain Injury Research

  • Products
  • Clinical Applications
  • News
  • Support
  • About Us
  • Contact

Mobile nav

how can i call x, y position value from target table

how can i call x, y position value from target table

Posted on Jul 22, 2019

DWQA Questions › Category: Kinarm End-Point Lab › how can i call x, y position value from target table
0 Vote Up Vote Down
Yihui Xu asked 4 years ago

I am looking to make the home position a variable that I can manipulate in the KINARM, but as of right now I am hard coding the home position. Is there any way to define the x and y coordinates of the home position as variables in Simulink (i.e., col_x, col_y), so that I can input the actual values later on in the KINARM?

1 Answers
0 Vote Up Vote Down
Koloman Varady Staff answered 4 years ago

Hi Yihui,
The way I would do this is to use the Target_Table and set the x-y values there in the first 2 columns. In the Trial_Protocol, you could create a column that would set the row you wanted to use to set your x-y coordinates.
You can then use a Stateflow output to a selector to select the row of the Target Table and use the col_x and col_y constants (already defined in every Kinarm task) to pick out the x and y from the task protocol and modify your stimuli.
I’ve attached a picture of what that might look like

Cheers,
Koloman

Yihui Xu replied 4 years ago

Thanks! but i still wonder so how can i get get target_Table first?

Koloman Varady Staff replied 4 years ago

Create a From tag (you can find the From block in the Library Browser). Then when you open it, click “UpdateTags” and then the Goto tag drop down will have a list of a whole bunch of available tags (these are the ones we provide for you use – you can see them described in the task programming guide in section 10.9 Available ‘Tags’ (From and Goto Blocks), Target_Table is one of the available tags and it contains a matrix that corresponds to the entire target table in your task protocol.

You can create your own Goto tags and corresponding From tags. Having a Goto and a From is the same thing as drawing a line between the two points. It’s just not as messy.

The kinematics are available from the From KINdata_bus, for example.

Yihui Xu replied 4 years ago

if i want to use selector to output an array called homeXY, homeXY[0] is the x value of home position, homeXY[1] is the y value of home position so that i can use the value in simulink, then what output size value should i put in the selector in your picture?

Koloman Varady Staff replied 4 years ago

It’s already set up that way. The way it’s set up in the picture is it outputs a two element vector, [col_x col_y]. If you look in the Parameter Table Defn block Target Table tab, col_x = 1 and col_y is a constant = 2.

The selector (as set up there), will go to the Target Table get the elements Target_Table(home_target_row, 1:2). If you plug the output from the selector into a MATLAB function (you could call the input variable homeXY and you’ll have access to that 2 element vector.

As well, in Simulink (outside of default C based Stateflow), arrays are indexed starting at 1.

Cheers,
Koloman

Yihui Xu replied 4 years ago

if i want to use selector to output an array called homeXY, homeXY[0] is the x value of home position, homeXY[1] is the y value of home position so that i can use the value in simulink, then what output size value should i put in the selector in your picture?

Yihui Xu replied 4 years ago

But when i try to call homeXY[2], the simulink shows coder error: Subscript [2] out of range for matrix Input Data ‘homeXY’ (#1621). Valid subscript range is 0…1 Please refer to object.

Yihui Xu replied 4 years ago

btw, do u know how can i upload images on this forum? so that i can describe my problem more clearly.

Koloman Varady Staff replied 4 years ago

If you edit a comment, there’s an icon for inserting images that are uploaded to the Internet.

You can always send images or models to our support email (support@bkintechnologies) as well if you want to be more detailed.

Support

  • User Guides & Documentation
  • Software Downloads
  • Install/Maintain Your KINARM Lab
  • Training Videos
  • New User Training
  • Creating Custom Tasks
  • Sample Custom Tasks
  • Q&A Forum
  • Publications by Research Area

Products

  • Platform Comparison
  • Kinarm Exoskeleton Lab
  • Kinarm End-Point Lab
  • Kinarm Standard Tests
  • Dexterit-E
  • Dexterit-E Explorer
  • NHP Kinarm Exoskeleton Lab

Clinical Applications

  • Clinical Applications
    • Stroke and TIA
    • Traumatic Brain Injury (TBI)
    • Neurological Disease
    • Pediatric
    • Primarily Non-Neurological
  • Clinical Research Sites
  • Publications

News

  • Kinarm News
  • Events
    • Neuroscience
    • Kinarm Camp
  • Product Notices
  • @KinarmLab Twitter Feed
  • Open Jobs

Support

  • Kinarm Help & Support
  • User Guides & Documentation
  • Software Downloads
  • Installing & Maintaining Your Kinarm Lab
  • Training Videos
  • New User Training
  • Creating Custom Tasks
  • Sample Custom Tasks
  • Q&A Forum

About Us

  • About Us
  • Our People
  • Quality
  • Supplier Requirements
  • End-User License Agreement
  • Intellectual Property
  • Privacy & Terms

Contact

  • Contact Kinarm
    • International Sales Agents
  • Request an Account
footer-logo

140 Railway St. Kingston, ON K7K 2L9 Canada Toll Free: (888) 533-4393 Phone: (613) 507-4393 info@kinarm.com

© Copyright BKIN Technologies. All Rights Reserved

Quality | Privacy Policy | Web design/development by 1dea Design + Media Inc.