Skip to content

Commit

Permalink
Fixed "Simulink encountered an error while allocating a handle object…
Browse files Browse the repository at this point in the history
… in MATLAB System block"

- The error was occuring only after upgrade to MATLAB 2020b.
  (Check #15)
- Removed parent class "handle" from KinDynComputations class definition.
- Saved changes in 2020b format file `robotDynamicsWithContacts_lib_2020b.slx`.
- Exported changes in 2019b format file `robotDynamicsWithContacts_lib.slx`.
- Renamed test model files adding respective suffixes 2019b, 2020a and 2020b.
  (test models content haven't changed apart from the Simulink version)
  • Loading branch information
nunoguedelha committed Feb 12, 2021
1 parent e14d450 commit 266512a
Show file tree
Hide file tree
Showing 8 changed files with 2,542 additions and 301 deletions.
4 changes: 2 additions & 2 deletions lib/+iDynTree2WBTmappers/KinDynComputations.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
classdef KinDynComputations < handle
classdef KinDynComputations
%KINDYNCOMPUTATIONS The calss wraps the iDynTree::KinDynComputations methods using Simulink function calls.
% Detailed explanation goes here

Expand All @@ -14,7 +14,7 @@
function obj = KinDynComputations()
end

function setRobotState(obj,w_H_b,s,base_pose_dot,s_dot)
function obj = setRobotState(obj,w_H_b,s,base_pose_dot,s_dot)
% Sets the robot state the wrapper methods depend on
[obj.w_H_b,obj.s,obj.base_pose_dot,obj.s_dot] = deal(w_H_b,s,base_pose_dot,s_dot);
obj.NDOF = numel(s_dot);
Expand Down
2 changes: 1 addition & 1 deletion lib/+wbs/@Robot/Robot.m
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function set_robot_state(obj, w_H_b, s, base_pose_dot, s_dot)
% - s = [NDOF, 1] Joints position vector
% - base_pose_dot = [6,1] linear and angular velocity of the base
% - s_dot = [NDOF, 1] Joints velocity vector
obj.KinDynModel.kinDynComp.setRobotState(w_H_b, s, base_pose_dot, s_dot);
obj.KinDynModel.kinDynComp = obj.KinDynModel.kinDynComp.setRobotState(w_H_b, s, base_pose_dot, s_dot);
end

function M = get_mass_matrix(obj,motorInertias)
Expand Down
5 changes: 1 addition & 4 deletions lib/RobotDynamicsWithContacts/+robotDynWC/step_block.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@
% step_block This block takes as input the joint torques and the
% applied external forces and evolves the state of the robot

properties
robot_config = struct();
end

properties (Nontunable)
robot_config;
contact_config;
physics_config;
OutputBusName = 'bus_name';
Expand Down
Binary file modified lib/RobotDynamicsWithContacts/robotDynamicsWithContacts_lib.slx
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 266512a

Please sign in to comment.