enforceStateBounds
Reduce state to state bounds
Description
reduces the specified states boundedStates
= enforceStateBounds(space
,states
)states
to the state bounds in the
StateBounds
property of the specified state space object
space
.
Examples
Enforce State Bounds for SE(3) States
Create an SE(3) state space object.
space = stateSpaceSE3([-1 1; ... -2 2; ... -10 10; ... -inf inf; ... -inf inf; ... -inf inf; ... -inf inf])
space = stateSpaceSE3 with properties: Name: 'SE3' StateBounds: [7x2 double] NumStateVariables: 7 WeightXYZ: 1 WeightQuaternion: 0.1000
Create a pair of states in 3-D space.
state1 = [2 10 3 2 0 0 0.8]; state2 = [223 100 3 2 2 12 5];
Enforce state bounds for a single state.
boundedState = enforceStateBounds(space,state1)
boundedState = 1×7
1.0000 2.0000 3.0000 2.0000 0 0 0.8000
Enforce state bounds for multiple states.
boundedStates = enforceStateBounds(space,[state1; state2])
boundedStates = 2×7
1.0000 2.0000 3.0000 2.0000 0 0 0.8000
1.0000 2.0000 3.0000 2.0000 2.0000 12.0000 5.0000
Input Arguments
space
— State space object
stateSpaceSE2
object | stateSpaceSE3
object | stateSpaceDubins
object | stateSpaceReedsShepp
object
State space object, specified as a stateSpaceSE2
,
stateSpaceSE3
,
stateSpaceDubins
, or stateSpaceReedsShepp
object.
states
— Unbounded states
n-by-3 matrix of real values | n-by-7 matrix of real values
Unbounded states, specified as an n-by-3 or n-by-7 matrix of real values.
For the 2-D state space objects stateSpaceSE2
,
stateSpaceDubins
, and stateSpaceReedsShepp
, each row is of form [x y theta]
,
which defines the xy-position and orientation angle
theta
of a state in the state space.
For the 3-D state space object stateSpaceSE3
,
each row is of form [x y z qw qx qy qz]
, which defines the
xyz-position and quaternion orientation [qw qx qy
qz]
of a state in the state space.
Data Types: single
| double
Output Arguments
boundedStates
— Bounded states
n-by-3 matrix of real values | n-by-7 matrix of real values
Bounded states, returned as an n-by-3 or
n-by-7 matrix of real values. The value of n is
same as for states
input argument.
The function truncates each of the specified unbounded states to the bounds
specified in the StateBounds
property of the state space object
space
.
For the 2-D state space objects stateSpaceSE2
,
stateSpaceDubins
, and stateSpaceReedsShepp
, each row is of form [x y theta]
,
which defines the xy-position and orientation angle
theta
of the bounded states.
For the 3-D state space object stateSpaceSE3
,
each row is of form [x y z qw qx qy qz]
, which defines the
xyz-position and quaternion orientation [qw qx qy
qz]
of the bounded states.
Data Types: single
| double
Version History
Introduced in R2019b
See Also
stateSpaceSE2
| stateSpaceSE3
| stateSpaceDubins
| stateSpaceReedsShepp
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)