Issues setting CoordinateSystem for sim3d.Actor to MATLAB in Simulink; need correct initialization method. Also need third-person view in Simulation 3D Scene Configuration
I’m encountering issues when trying to set the CoordinateSystem property for the sim3d.Actor object in Simulink. According to the documentation, this property should be configurable to use the MATLAB coordinate system, but it results in an error. I need guidance on the correct method to achieve this in the initialization script.
Additionally, I want to configure the Simulation 3D Scene Configuration block so that when selecting my Actor defined in the Simulation 3D Actor block as the Scene view, the view is in third person rather than the default coordinates [0 0 0].
Issue 1: Changing Coordinate System
I am trying to set the CoordinateSystem property for a sim3d.Actor object to use the MATLAB coordinate system. Here is the current initialization script:
fileName = "QuadCopter_Body.stl";
Body = sim3d.Actor(‘ActorName’, ‘Body’, …
‘Mobility’, sim3d.utils.MobilityTypes.Movable, …
‘ActorClassId’, sim3d.utils.SemanticType.Vehicle, …
‘CoordinateSystem’, ‘MATLAB’);
World.add(Body, Actor);
Body.load(fileName, [1 1 1]/100);
Body.Color = [0, 0, 1];
Body.Scale = [10 10 10];
Translation = [0.341 0.286 0.042;
-0.341 0.286 0.042;
0.341 -0.286 0.042;
-0.341 -0.286 0.042];
propellerFileName = "QuadCopter_Propeller.stl";
for propellerIndex = 1:4
actorName = sprintf(‘Propeller%d’, propellerIndex);
Propeller = sim3d.Actor(‘ActorName’,actorName, …
‘Mobility’, sim3d.utils.MobilityTypes.Movable, …
‘ActorClassId’, sim3d.utils.SemanticType.Vehicle);
World.add(Propeller, Actor);
Propeller.load(propellerFileName, [1 1 1]/100);
Propeller.Color = [1, 0, 0];
Propeller.Translation = Translation(propellerIndex, :);
Propeller.Rotation = [0 0 0 ];
Propeller.Scale = [10 10 10];
end
Actor.save("quadcopter.mat")
This is the error:
‘CoordinateSystem’ is not a recognized parameter. For a list of valid name-value pair argument, see the documentation for this function.
Issue 2: Setting Third-Person View
I also want to set the view in the Simulation 3D Scene Configuration block to be in third person when selecting my Actor defined in the Simulation 3D Actor block. Currently, the view defaults to the coordinates [0 0 0]. How can I change this view to a third-person perspective?I’m encountering issues when trying to set the CoordinateSystem property for the sim3d.Actor object in Simulink. According to the documentation, this property should be configurable to use the MATLAB coordinate system, but it results in an error. I need guidance on the correct method to achieve this in the initialization script.
Additionally, I want to configure the Simulation 3D Scene Configuration block so that when selecting my Actor defined in the Simulation 3D Actor block as the Scene view, the view is in third person rather than the default coordinates [0 0 0].
Issue 1: Changing Coordinate System
I am trying to set the CoordinateSystem property for a sim3d.Actor object to use the MATLAB coordinate system. Here is the current initialization script:
fileName = "QuadCopter_Body.stl";
Body = sim3d.Actor(‘ActorName’, ‘Body’, …
‘Mobility’, sim3d.utils.MobilityTypes.Movable, …
‘ActorClassId’, sim3d.utils.SemanticType.Vehicle, …
‘CoordinateSystem’, ‘MATLAB’);
World.add(Body, Actor);
Body.load(fileName, [1 1 1]/100);
Body.Color = [0, 0, 1];
Body.Scale = [10 10 10];
Translation = [0.341 0.286 0.042;
-0.341 0.286 0.042;
0.341 -0.286 0.042;
-0.341 -0.286 0.042];
propellerFileName = "QuadCopter_Propeller.stl";
for propellerIndex = 1:4
actorName = sprintf(‘Propeller%d’, propellerIndex);
Propeller = sim3d.Actor(‘ActorName’,actorName, …
‘Mobility’, sim3d.utils.MobilityTypes.Movable, …
‘ActorClassId’, sim3d.utils.SemanticType.Vehicle);
World.add(Propeller, Actor);
Propeller.load(propellerFileName, [1 1 1]/100);
Propeller.Color = [1, 0, 0];
Propeller.Translation = Translation(propellerIndex, :);
Propeller.Rotation = [0 0 0 ];
Propeller.Scale = [10 10 10];
end
Actor.save("quadcopter.mat")
This is the error:
‘CoordinateSystem’ is not a recognized parameter. For a list of valid name-value pair argument, see the documentation for this function.
Issue 2: Setting Third-Person View
I also want to set the view in the Simulation 3D Scene Configuration block to be in third person when selecting my Actor defined in the Simulation 3D Actor block. Currently, the view defaults to the coordinates [0 0 0]. How can I change this view to a third-person perspective? I’m encountering issues when trying to set the CoordinateSystem property for the sim3d.Actor object in Simulink. According to the documentation, this property should be configurable to use the MATLAB coordinate system, but it results in an error. I need guidance on the correct method to achieve this in the initialization script.
Additionally, I want to configure the Simulation 3D Scene Configuration block so that when selecting my Actor defined in the Simulation 3D Actor block as the Scene view, the view is in third person rather than the default coordinates [0 0 0].
Issue 1: Changing Coordinate System
I am trying to set the CoordinateSystem property for a sim3d.Actor object to use the MATLAB coordinate system. Here is the current initialization script:
fileName = "QuadCopter_Body.stl";
Body = sim3d.Actor(‘ActorName’, ‘Body’, …
‘Mobility’, sim3d.utils.MobilityTypes.Movable, …
‘ActorClassId’, sim3d.utils.SemanticType.Vehicle, …
‘CoordinateSystem’, ‘MATLAB’);
World.add(Body, Actor);
Body.load(fileName, [1 1 1]/100);
Body.Color = [0, 0, 1];
Body.Scale = [10 10 10];
Translation = [0.341 0.286 0.042;
-0.341 0.286 0.042;
0.341 -0.286 0.042;
-0.341 -0.286 0.042];
propellerFileName = "QuadCopter_Propeller.stl";
for propellerIndex = 1:4
actorName = sprintf(‘Propeller%d’, propellerIndex);
Propeller = sim3d.Actor(‘ActorName’,actorName, …
‘Mobility’, sim3d.utils.MobilityTypes.Movable, …
‘ActorClassId’, sim3d.utils.SemanticType.Vehicle);
World.add(Propeller, Actor);
Propeller.load(propellerFileName, [1 1 1]/100);
Propeller.Color = [1, 0, 0];
Propeller.Translation = Translation(propellerIndex, :);
Propeller.Rotation = [0 0 0 ];
Propeller.Scale = [10 10 10];
end
Actor.save("quadcopter.mat")
This is the error:
‘CoordinateSystem’ is not a recognized parameter. For a list of valid name-value pair argument, see the documentation for this function.
Issue 2: Setting Third-Person View
I also want to set the view in the Simulation 3D Scene Configuration block to be in third person when selecting my Actor defined in the Simulation 3D Actor block. Currently, the view defaults to the coordinates [0 0 0]. How can I change this view to a third-person perspective? sim3d, coordinatesystem, simulation3dactor, sceneconfiguration, simulink MATLAB Answers — New Questions