Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed serialization and params #49

Open
wants to merge 1 commit into
base: cart-pole-3
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cartpole/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ async def register(topic_name, name, schema) -> Registration:
async def register_class(topic_name, cls) -> Registration:
name = cls.__name__
assert issubclass(cls, BaseModel), f'Required pydantic model, but got {name}'
return await register(topic_name, name, cls.model_json_schema())
return await register(topic_name, name, json.dumps(cls.model_json_schema()))

# preventive topic creation
registration_log = await register(
Expand Down
2 changes: 1 addition & 1 deletion cartpole/simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def __init__(self, integration_step: float = 0.001):
cart_position=0.5, cart_velocity=2.0, cart_acceleration=5.0
),
control_limit=Limits(),
parameters=Parameters(g=9.81, b=0, k=0.3),
parameters=Parameters(gravity=9.81, friction_coef=0, mass_coef=0.3),
)

self._state = State(error=Error.NEED_RESET)
Expand Down