Kinarm | Interactive Robotics Brain Injury Research

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

Mobile nav

Cursor “trail”

Cursor “trail”

Posted on Mar 15, 2015

DWQA Questions › Category: Custom Task Development › Cursor “trail”
0 Vote Up Vote Down
Duncan McLean Staff asked 8 years ago

From:brunfeld
I am trying to make the cursor feedback a little more robust, and my thought was to add a trail. This would be something similar to the pointer trail option in the Windows Pointer Options tab under mouse settings.

Ideally, I would program it such that this trail could act like the Windows version, ie: the cursor leaves a copy behind for a finite amount of time, OR I could leave the trail until the participant successfully hits a target. Any help would be most appreciated!

Thank you,
Alex.

1 Answers
0 Vote Up Vote Down
Duncan McLean Staff answered 8 years ago

There is no good way to keep a full path since that would likely be too many VCodes. However, you can leave behind the last X number of vodes. Send the output of the Hand Feedback block to an embedded MATLAB function like (as edited by brunfeld):

function VCODETrail = makeTrail(handFeedbackVcode)
%#create a permanent variable that will exist in between calls to this method.
persistent trail
persistent ignoreCounter

if isempty(trail)
%this will leave behind the last 10 positions, adjust this as required.
trail = zeros(10, 70);
ignoreCounter = 40; %ensure we record the first VCode
end

%this will ensure we only grab each 40th VCode. The model runs at 2KHz,
%so if we don’t do this then there will just be a solid trail of VCodes where you
%can’t see between any of them. You can adjust this number as required!
if ignoreCounter < 40
ignoreCounter = ignoreCounter + 1;
VCODETrail = trail;
return;
end

%reset the counter so the above if statement still works
ignoreCounter = 0;
%This will help fade out the older VCodes
opacityChange = 100.0/ size(trail,1);
opacity = opacityChange;

%Move each VCode one position down the list.
for row=size(trail,1):-1:2
trail(row,:) = trail(row-1,:);

%#This code changes the opacity of the VCode and therefore fades it out.
trail(row, 9) = opacity;
opacity = opacity + opacityChange;
end

trail(1,:) = handFeedbackVcode(1,:);
VCODETrail = trail;
end

I didn’t test this code but hopefully it gives you the idea of what you need to do. Let me know if this idea works for you. There are at least a few other ways to handle this.

Duncan

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.