How to get data values from struct and save it in struct
1 view (last 30 days)
Show older comments
Hi all. First define what is rpoint, and rset: rpoint is from Robotic Toolbox funciton that define robot-positions with coordinates and motion-properties. rset sets up interpreter-, toolbox- and motion-properties
Syntax:
Point = rpoint( x,y,z,o,a,t, 'pose', 'RELATION', 'INTERPOLATION',['PROPERTY', VALUE ])
Example :
Point = rpoint(177.957,349.963,-229.418,15.983,179.610,-162.582)
Syntax:
ID = rset( HANDLE, 'PROPERTY', VALUE, ['now'])
Example:
rset( HANDLE, 'base', rpoint(10,10,10,0,0,0) );
I need to get values from struct and put them into code line, like this:
Kawasaki = 1; % HANDLE
getPoseValue = [Pose.x,Pose.y,Pose.z,Pose.o,Pose.t,Pose.j1,Pose.j2,Pose.j3,Pose.j4,Pose.j5,Pose.j6,Pose.poscfg,Pose.typ,Pose.move,Pose.signal,Pose.pulse,Pose.speed,Pose.acceleration,Pose.deceleration,Pose.accuracy,Pose.wait];
temp = num2cell(getPoseValue);
rset( Kawasaki, 'base', rpoint(temp{:}) );
But it does not work well:
Struct contents reference from a non-struct array object.
Error in rset
Error in testtt (line 4)
rset( Kawasaki, 'base', rpoint(temp{:}) );


I need to get values from struct and put them into code line, like this:

It will help me with getting the actual pose and defines is as base.
If anyone can help with this I'll be gratefull.
7 Comments
Walter Roberson
on 24 Jan 2018
You could try
dbstop if caught error
and run, which might get you into the debugger at the line in rset that is complaining; from there you might be able to trace back to see what it is trying to access and where that variable came from.
Answers (2)
Walter Roberson
on 23 Jan 2018
rpoint can take at most 6 numeric parameters before it needs 'pose' followed by a string representing a relationship followed by a string representing an interpolation, with name/value pairs after that. You are passing in something like 20 numeric parameters instead. I suspect that rpoint is failing and is returning [] instead of the structure that rset expects.
0 Comments
See Also
Categories
Find more on Graphics Performance in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!