Skip to content

Commit 1637e50

Browse files
committed
chore: Update Longitudinal_control.md with additional details for requestSpeedChange API
1 parent 9956864 commit 1637e50

File tree

3 files changed

+27
-15
lines changed

3 files changed

+27
-15
lines changed

docs/developer_guide/Longitudinal_control.md

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,20 @@ Set functions directly changes the speed, acceleration, or deceleration of the e
2828
### requestSpeedChange
2929
By using `API::requestSpeedChange`, you can change the speed of the entity.
3030
MiscObjectEntity can not be controlled by this API.
31+
For EgoEntity, speed can only be changed before the simulation starts.
32+
API takes several types of value sets. Description of each type is as follows.
3133

34+
#### Values
3235
| Value | Type | Description |
3336
| ------------ | ------ | -------------------------------------------------------------- |
3437
| name | string | Name of the entity. |
3538
| target_speed | double | Target speed of the entity. |
3639
| continuous | bool | If true the entity will keep the speed until the next command. |
37-
#### EgoEntity
38-
`target_speed` will be set as initial target speed of the EgoEntity only before the scenario starts.
3940

40-
#### Other entity
4141
The function will change entities `target_speed` to given immediately.
4242
If `continuous` is set to `false`, job to accelerate to target speed will be deleted after the velocity has reached the target speed. If set to `true`, the entity will keep the speed until the next longitudinal control command ordered. It will accelerate on maximum acceleration rate set previously.
4343

44+
#### Values
4445
| Value | Type | Description |
4546
| ------------ | ------------------------ | -------------------------------------------------------------- |
4647
| name | string | Name of the entity. |
@@ -49,10 +50,6 @@ If `continuous` is set to `false`, job to accelerate to target speed will be del
4950
| constraint | speed_change::Constraint | Constraint type. |
5051
| continuous | bool | If true the entity will keep the speed until the next command. |
5152

52-
#### EgoEntity
53-
`target_speed` will be set as initial target speed of the EgoEntity only before the scenario starts.
54-
55-
#### Other entity
5653
If `continuous` is set to `false`, job to accelerate to target speed will be deleted after the velocity has reached the target speed. If set to `true`, the entity will keep the speed until the next longitudinal control command ordered.
5754

5855
##### Longitudinal Acceleration
@@ -94,19 +91,30 @@ flowchart LR
9491
B -- NONE ---> O[[ChangeTargetSpeed]];
9592
```
9693

94+
#### Values
95+
By using `speed_change::RelativeTargetSpeed` you can set the target speed of the entity relative to another entity.
9796
| Value | Type | Description |
9897
| ------------ | --------------------------------- | -------------------------------------------------------------- |
9998
| name | string | Name of the entity. |
10099
| target_speed | speed_change::RelativeTargetSpeed | Relative target speed. |
101100
| continuous | bool | If true the entity will keep the speed until the next command. |
102101

102+
If `continuous` is set to `false`, job to accelerate to target speed will be deleted after the velocity has reached the target speed. If set to `true`, the entity will keep the speed until the next longitudinal control command ordered.
103+
104+
`target_speed.reference_entity_name` is the name of the entity that the target speed is relative to. The target speed of the entity will be same as the target speed of the reference entity.
105+
- By setting `target_speed.type` to `DELTA`, you can set the target speed of the entity to be the target speed of the reference entity plus the value of `target_speed.value`.
106+
- By setting `target_speed.type` to `FACTOR`, you can set the target speed of the entity to be the target speed of the reference entity multiplied by the value of `target_speed.value`.
107+
108+
#### Values
109+
By using `speed_change::RelativeTargetSpeed` you can set the target speed of the entity relative to another entity.
103110
| Value | Type | Description |
104111
| ------------ | --------------------------------- | -------------------------------------------------------------- |
105112
| name | string | Name of the entity. |
106113
| target_speed | speed_change::RelativeTargetSpeed | Relative target speed. |
107114
| transition | speed_change::Transition | Transition type. |
108115
| constraint | speed_change::Constraint | Constraint type. |
109116
| continuous | bool | If true the entity will keep the speed until the next command. |
117+
It works the same as explained before.
110118

111119
### requestSynchronize
112120
By using `API::requestSynchronize`, you can request the entity to adjust speed to stop at the designated lanelet by the time target entity crosses the another designated lanelet.
@@ -120,16 +128,20 @@ By using `API::requestSynchronize`, you can request the entity to adjust speed t
120128
| target_speed | Target speed for controlling entity (meter per second). |
121129
| tolerance | Tolerance for how much margin to accept to stop at the target (meter). |
122130

131+
![requestSynchronize](images/Longitudinal_control/synchronizedAction.png)
132+
As shown in the image, the entity will adjust it's speed to `target_speed` on `entity_target` at the time the target entity crosses the `target_sync_pose`. `tolerance` is the margin of error for the entity to stop at the `entity_target`. The target entity could be set by giving the name of the entity as `target_name`.
133+
123134
### setLinearVelocity
124-
By using `API::setLinearVelocity`, you can set the linear velocity of the entity.
135+
By using `API::setLinearVelocity`, you can set the linear velocity of the entity immediately. It will ignore the physics of the entity and set the value directly.
125136

126137
| Value | Type | Description |
127138
| --------------- | ------ | ------------------------------ |
128139
| name | string | Name of the entity. |
129140
| linear_velocity | double | Linear velocity of the entity. |
130141

142+
131143
### setTwist
132-
By using `API::setTwist`, you can set the twist of the entity.
144+
By using `API::setTwist`, you can set the twist of the entity immediately. It will ignore the physics of the entity and set the value directly.
133145

134146
| Value | Type | Description |
135147
| ----- | ------------------------- | -------------------- |
@@ -138,7 +150,7 @@ By using `API::setTwist`, you can set the twist of the entity.
138150

139151
### setAcceleration
140152

141-
By using `API::setAcceleration`, you can set the acceleration of the entity.
153+
By using `API::setAcceleration`, you can set the acceleration of the entity immediately. It will ignore the physics of the entity and set the value directly.
142154

143155
| Value | Type | Description |
144156
| ------------ | ------------------------- | --------------------------- |
@@ -147,7 +159,7 @@ By using `API::setAcceleration`, you can set the acceleration of the entity.
147159

148160
### setAccelerationLimit
149161

150-
By using `API::setAccelerationLimit`, you can set the acceleration limit of the entity.
162+
By using `API::setAccelerationLimit`, you can set the acceleration limit of the entity immediately.
151163

152164
| Value | Type | Description |
153165
| ------------ | ------ | --------------------------------- |
@@ -156,7 +168,7 @@ By using `API::setAccelerationLimit`, you can set the acceleration limit of the
156168

157169
### setAccelerationRateLimit
158170

159-
By using `API::setAccelerationRateLimit`, you can set the acceleration rate limit of the entity.
171+
By using `API::setAccelerationRateLimit`, you can set the acceleration rate limit of the entity immediately.
160172

161173
| Value | Type | Description |
162174
| ----------------- | ------ | -------------------------------------- |
@@ -165,7 +177,7 @@ By using `API::setAccelerationRateLimit`, you can set the acceleration rate limi
165177

166178
### setDecelerationLimit
167179

168-
By using `API::setDecelerationLimit`, you can set the deceleration limit of the entity.
180+
By using `API::setDecelerationLimit`, you can set the deceleration limit of the entity immediately.
169181

170182
| Value | Type | Description |
171183
| ------------ | ------ | --------------------------------- |
@@ -174,7 +186,7 @@ By using `API::setDecelerationLimit`, you can set the deceleration limit of the
174186

175187
### setDecelerationRateLimit
176188

177-
By using `API::setDecelerationRateLimit`, you can set the deceleration rate limit of the entity.
189+
By using `API::setDecelerationRateLimit`, you can set the deceleration rate limit of the entity immediately.
178190

179191
| Value | Type | Description |
180192
| ----------------- | ------ | -------------------------------------- |
@@ -183,7 +195,7 @@ By using `API::setDecelerationRateLimit`, you can set the deceleration rate limi
183195

184196
### setVelocityLimit
185197

186-
By using `API::setVelocityLimit`, you can set the velocity limit of the entity.
198+
By using `API::setVelocityLimit`, you can set the velocity limit of the entity immediately.
187199

188200
| Value | Type | Description |
189201
| --------------- | ------ | ----------------------------- |
-353 KB
Binary file not shown.
72.6 KB
Loading

0 commit comments

Comments
 (0)