Open
Conversation
…work previously in my_ddpg_project)
…esary for the robot to be controlled by the python scripts.
train.py: - creates a gym environment and a model using SAC with HER and trains for a specified number of timesteps - saves to a zip file test.py - reloads environment and module and runs deterministicly for several episodes
- train.py set for 1M timesteps of training - test.py filepath to model updated to reflect accurate location - pick_and_place.py import statement changed to reflect new filestructure Added sac_her_push_1M.zip - stores model trained by sac_her algorithm on the push environment for 1M timesteps
- Updated and advanced train.py for the push task that includes logging, vectorized environments, and periodic recorded evaluations
… with SAC_HER with basic logging to tensorboard. We also addressed filepath and importing issues with our current filestructure. With the new implementations you can run, for example, the test.py for push with the following terminal command WHILE IN the franka_mujoco folder: python3 -m examples.push.sac.test Additionally an issue with the panda_mocap.xml file was fixed so now the arm should move fully.
…f any packages we need to insert. In this way, imports work from everywhere.
….4.0, in creating the SAC model, replay_buffer_kwargs needs only two options here:
replay_buffer_kwargs=dict(
goal_selection_strategy=GoalSelectionStrategy.FUTURE,
copy_info_dict=False,
along with a learning_starts parameter that is set to max_length*num_virtual_envs.
We have not explicitly extracted the max_length_steps in one rollout but think it is 100. So the MAX_EPISODE_LENGTH is currently set to 100 * 5 virtual environments = 500.
Almost final. Still having trouble lifting the block in the air.
… try to debug why no learning was occuring. Changes include commenting VecNormalize in train_advanced.py as well as changing things like batch size and the copy_info_dict arguement under the HerReplayBuffer. Changes to train.py were very minimal.
Some refinements to sliding friction parameters in panda_mocap.xml to minimize sliding. Helped some but not perfect. TODO: - fix sliding - better confition for success. - print success. - only save rollouts that succeeded
…or alongside fingertip `<geom>` declarations to increase friction.
These changes ultimately did not result in successful pinch picks but were kept.
Summary of Changes:
1. Use full 6-D friction (sliding + torsion + rolling).
2. Employ realistic elliptic friction cones.
3. Detect all contacts on each fingertip.
4. Use much stiffer, well‐damped contact springs.
Explanations:
1. What does `condim` do? Why change from 4 to 6?
The `condim` attribute on a `<geom>` controls **how many contact‐constraint dimensions MuJoCo enforces** at that contact point:
* **`condim="3"`** (the default) gives you 1 normal dimension + 2 tangential sliding directions (standard Coulomb friction).
* **`condim="4"`** adds **torsional friction** about the contact normal, resisting the block twisting out of your fingers.
* **`condim="6"`** adds **rolling friction** as well—two more dimensions resisting the block rolling away around axes tangent to the contact patch.
By bumping from `4→6`, you preserve both torsional **and** rolling resistance. In a pinch grasp, the block can still roll out of a 4-dimensional contact, but with 6 you get full 3D frictional impedance, making the grip much more robust against both twists **and** rolls.
---
2. Where to put the elliptic‐cone / `impratio` change?
These go in your global `<option>` block at the top of `panda_mocap.xml`. For example, right under `<mujoco>`:
```xml
<mujoco model="panda">
<!-- … other top‐level settings … -->
<option
cone="elliptic" <!-- switch from default “pyramidal” friction cones -->
impratio="10" <!-- make friction boundaries “harder” without raising μ -->
noslip_iterations="0" <!-- leave at 0 unless you enable noslip -->
/>
<!-- … rest of your assets, worldbody, etc. … -->
```
That single `<option>` line activates **elliptic** friction cones and boosts the friction‐to‐normal impedance ratio to 10.
---
3. Where to enable multi-CCD / nativeCCD?
Also in the `<option>` block—just add these attributes alongside the above:
```xml
<option
cone="elliptic"
impratio="10"
multiccd="true" <!-- enable multi‐point continuous‐collision detection -->
nativeccd="true" <!-- enable MuJoCo’s native CCD as a fallback -->
/>
```
That ensures MuJoCo finds *all* contact points on your fingertips (not just one), which is critical for reliable pinch grasps.
---
4. Where to tweak `solref` / `solimp` on your `<geom>`s?
Any `<geom>` you care about—typically your fingertip collision geoms—can get stiffer, more damped contact springs by adding `solref` and `solimp`. For example, in your `<default class="fingertip_pad_collision_1">` section:
```xml
<default class="fingertip_pad_collision_1">
<geom
type="box"
size="0.0085 0.004 0.0085"
pos="0 0.0055 0.0445"
condim="6"
friction="45.0 1.0 0.8"
solref="0.02 1" <!-- stiffness: [timeconst, damping ratio] -->
solimp="0.9 0.99 0.0001" <!-- [softness, restitution, regularization] -->
/>
</default>
```
Or inline on each fingertip `<geom>`:
```xml
<geom class="fingertip_pad_collision_2"
condim="6"
friction="45 1 0.8"
solref="0.02 1"
solimp="0.9 0.99 0.0001"/>
```
Those values make the contact springs both **stiffer** (small `timeconst`) and **highly damped**, reducing slow slips without blowing up the simulation.
---
#### Putting it all together
Near the top of `panda_mocap.xml` you’ll end up with something like:
```xml
<mujoco model="panda">
<option
cone="elliptic"
impratio="10"
multiccd="true"
nativeccd="true"
noslip_iterations="0"
/>
...
<default class="fingertip_pad_collision_1">
<geom
type="box"
size="0.0085 0.004 0.0085"
pos="0 0.0055 0.0445"
condim="6"
friction="45.0 1.0 0.8"
solref="0.02 1"
solimp="0.9 0.99 0.0001"
/>
</default>
<!-- repeat for your other fingertip_pad_collision_x defaults -->
...
</mujoco>
```
These changes should give better physical pinch grasps without weld shortcuts.
…eporting. - Created activate and deactivate weld functions in pick_place_demo.py that were activated/deactivated during lift phase of pick. - Improved error calculations and conditions to ensure smooth transitions. - Improved message logs to screen - Ensured that only successful runs have their data recorded. - Ensured observations, actions, rewards, terminated, truncateds, and dones were all saved to file.
- improved functionality to save in same directory as demo .py location.
…ges to train_advanced (commeted videos and other sac specific changes)
…single.py from the push folder with naming changes
Small improvements indicating how to activate a file and how to create an alias
…rticularly to be able to read and write to /home/student/data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.