Skip to content

Commit

Permalink
it should raise error (#594)
Browse files Browse the repository at this point in the history
* it should raise error

* restore

* raise error?

* test pass merge
  • Loading branch information
QuanyiLi committed Jan 7, 2024
1 parent ca2a869 commit 9276a2c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
9 changes: 6 additions & 3 deletions documentation/source/sensors.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@
"execution_count": null,
"id": "425d66f9-118f-4b91-a343-ef1385281ba8",
"metadata": {
"tags": []
"tags": [
"skip_execution"
]
},
"outputs": [],
"source": [
Expand All @@ -85,7 +87,6 @@
" show_terrain=not os.getenv('TEST_DOC'),\n",
" sensors=dict(rgb=[RGBCamera, *size]))\n",
"\n",
"\n",
"env = BaseEnv(env_cfg)\n",
"env.reset()\n",
"print(\"Available sensors are:\", env.engine.sensors.keys())\n",
Expand All @@ -101,7 +102,9 @@
"execution_count": null,
"id": "1dd842e2-c89f-4715-af17-4a2d00f7bdd9",
"metadata": {
"tags": []
"tags": [
"skip_execution"
]
},
"outputs": [],
"source": [
Expand Down
7 changes: 3 additions & 4 deletions documentation/source/system_design.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"id": "e8b4bd74-6874-4dcb-ba93-78dc0172189b",
"metadata": {},
"source": [
"As we use the bullet engine for underlying physics simulation, the `self.engine.step()` is actually a wrapper for `BulletWorld.doPhysics(dt, 1, dt)`. It will forward the physics world by a time period, which is set to `0.1s` by default. The result is the vehicle's speed will be increased to $5\\ m/s$ at state $s'$ if it has a $4.9\\ m/s$ speed with a $1m\\ /s^2$ acceleration before advancing the simulation. \n",
"As we use the bullet engine for underlying physics simulation, the `self.engine.step()` is actually a wrapper to repeatedly execute `BulletWorld.doPhysics(dt, 1, dt)` several times which is determined by `decision_repeat`. It thus will forward the physics world by a time period, which is `dt x decision_repeat = 0.02 x 5 = 0.1s` by default. The result is the vehicle's speed will be increased to $5\\ m/s$ at state $s'$ if it has a $4.9\\ m/s$ speed with a $1m\\ /s^2$ acceleration before advancing the simulation.\n",
"\n",
"Before advancing the physics world, there may be some preparations required. For example, if the external input contains signals for controlling a certain vehicle, the steering angles and the throttle value should be set on the target vehicle before stepping it. Thus all these preprocessings are finished by calling `self.engine.before_step()`. \n",
"\n",
Expand All @@ -81,9 +81,8 @@
"If we dive deeper to check the `engine.before_step()`, `engine.step()`, and `engine.after_step()`. We will find that all three functions share the same structure. Take the `before_step()` function as the example. What the `engine.before_step()` does is actually sequentially executing `mgr.before_step()` for each manager. \n",
"```python\n",
"def before_step(self):\n",
" for _ in range(config[\"decision_repeat\"]):\n",
" for mgr in managers.values():\n",
" mgr.before_ste() # or mgr.step() or mgr.after_step()\n",
" for mgr in managers.values():\n",
" mgr.before_step() # or mgr.step() or mgr.after_step()\n",
"```\n",
"Thus the `engine.step()` is to sequentially execute `before_step()`, `step()`, and `after_step()` for all managers.\n",
"In addition, a simulation needs an initial state as the start point of everything. \n",
Expand Down

0 comments on commit 9276a2c

Please sign in to comment.