Skip to content

Skills refactor#154

Merged
spomichter merged 15 commits intodevfrom
skills_refactor
Apr 15, 2025
Merged

Skills refactor#154
spomichter merged 15 commits intodevfrom
skills_refactor

Conversation

@lukasapaukstys
Copy link
Copy Markdown
Contributor

@lukasapaukstys lukasapaukstys commented Apr 9, 2025

Summary

This PR allows the agent to accept the following types:

  • Skill
  • SkillLibrary

It also includes a refactor to reduce the amount of code needed to create an abstract skill.

Details

  • Private skill instantiation is still supported by inheriting SkillLibrary and calling:

    [SkillLibraryClass].create_instance(...)
  • If a skill does not require dependencies, it can be passed directly to the agent.

  • If a skill requires dependencies, a SkillLibrary should be used.

  • SkillLibrary manages underlying instance parameters. This is also why the agent accepts the SkillLibrary type directly.

Testing

To run the tests:

python3 -m tests.test_skill_library

@lukasapaukstys lukasapaukstys marked this pull request as ready for review April 9, 2025 05:01
Copy link
Copy Markdown
Contributor

@spomichter spomichter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall amazing super helpful and useful abstraction and the skill init is very clear. Added comments. Main things are just trivial semantic changes.

In the test file you dont have an example one-off skill creation example which would be helpful for developers.

so something like

class newSkill(AbstractRobotSkill):
     def call():
          print("do something")


self.skill_group.add(newSkill)

super().__init__(ros_control=ros_control, output_dir=output_dir, skills=skills)

# Unitree specific skill initialization
self.skills = skills
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But what if unitree go2 is initialized without skills?

@lukasapaukstys lukasapaukstys changed the base branch from main to dev April 11, 2025 02:05
…down a decorator section that's a todo; Adds clarity for skill calling in test file;
…'; Adds to test file with working tests; Throws error in the event a skill is called in a SkillLibrary that does not exist
spomichter
spomichter previously approved these changes Apr 15, 2025
Copy link
Copy Markdown
Contributor

@spomichter spomichter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved for merge into dev. Will test more.

Copy link
Copy Markdown
Contributor

@spomichter spomichter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved for merge into dev. Will test more.

@spomichter spomichter merged commit fe71795 into dev Apr 15, 2025
spomichter added a commit that referenced this pull request May 14, 2025
### Summary

This PR allows the agent to accept the following types:

- `Skill`
- `SkillLibrary`

It also includes a refactor to reduce the amount of code needed to create an abstract skill.

### Details

- Private skill instantiation is still supported by inheriting `SkillLibrary` and calling:
  ```python
  [SkillLibraryClass].create_instance(...)
  ```

- If a skill does not require dependencies, it can be passed directly to the agent.

- If a skill requires dependencies, a `SkillLibrary` should be used.

- `SkillLibrary` manages underlying instance parameters. This is also why the agent accepts the `SkillLibrary` type directly.

### Testing

To run the tests:

```bash
python3 -m tests.test_skill_library
```
@spomichter spomichter deleted the skills_refactor branch May 14, 2025 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants