Skip to content

Commit

Permalink
update gitignore and agent_test
Browse files Browse the repository at this point in the history
  • Loading branch information
thowell committed Feb 12, 2024
1 parent 49388aa commit dd6618d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 18 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
.vs/
# Exclude temporary folders
*.egg-info/
.eggs/
build/
build_cmake/
# Exclude macOS folder attributes
Expand Down
4 changes: 2 additions & 2 deletions mjpc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ add_library(
direct/trajectory.h
direct/model_parameters.cc
direct/model_parameters.h
spline/spline.cc
spline/spline.h
# spline/spline.cc
# spline/spline.h
app.cc
app.h
norm.cc
Expand Down
32 changes: 16 additions & 16 deletions python/mujoco_mpc/agent_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class AgentTest(parameterized.TestCase):
def test_set_task_parameters(self):
model_path = (
pathlib.Path(__file__).parent.parent.parent
/ "mjpc/tasks/cartpole/task.xml"
/ "build/mjpc/tasks/cartpole/task.xml"
)
model = mujoco.MjModel.from_xml_path(str(model_path))
with agent_lib.Agent(task_id="Cartpole", model=model) as agent:
Expand All @@ -56,7 +56,7 @@ def test_set_task_parameters(self):
def test_set_subprocess_working_dir(self):
model_path = (
pathlib.Path(__file__).parent.parent.parent
/ "mjpc/tasks/cartpole/task.xml"
/ "build/mjpc/tasks/cartpole/task.xml"
)
model = mujoco.MjModel.from_xml_path(str(model_path))

Expand All @@ -76,7 +76,7 @@ def test_set_subprocess_working_dir(self):
def test_step_env_with_planner(self):
model_path = (
pathlib.Path(__file__).parent.parent.parent
/ "mjpc/tasks/particle/task_timevarying.xml"
/ "build/mjpc/tasks/particle/task_timevarying.xml"
)
model = mujoco.MjModel.from_xml_path(str(model_path))
data = mujoco.MjData(model)
Expand Down Expand Up @@ -126,7 +126,7 @@ def test_action_averaging_doesnt_change_state(self, nominal):
# out physics, but the API should be implemented not to mutate the state
model_path = (
pathlib.Path(__file__).parent.parent.parent
/ "mjpc/tasks/cartpole/task.xml"
/ "build/mjpc/tasks/cartpole/task.xml"
)
model = mujoco.MjModel.from_xml_path(str(model_path))
data = mujoco.MjData(model)
Expand Down Expand Up @@ -161,7 +161,7 @@ def test_action_averaging_improves_control(self):
# expect action averaging to be a bit better
model_path = (
pathlib.Path(__file__).parent.parent.parent
/ "mjpc/tasks/cartpole/task.xml"
/ "build/mjpc/tasks/cartpole/task.xml"
)
model = mujoco.MjModel.from_xml_path(str(model_path))
data = mujoco.MjData(model)
Expand Down Expand Up @@ -213,7 +213,7 @@ def test_stepping_on_agent_side(self):
"""Test an alternative way of stepping the physics, on the agent side."""
model_path = (
pathlib.Path(__file__).parent.parent.parent
/ "mjpc/tasks/cartpole/task.xml"
/ "build/mjpc/tasks/cartpole/task.xml"
)
model = mujoco.MjModel.from_xml_path(str(model_path))
data = mujoco.MjData(model)
Expand Down Expand Up @@ -246,7 +246,7 @@ def test_stepping_on_agent_side(self):
def test_set_cost_weights(self):
model_path = (
pathlib.Path(__file__).parent.parent.parent
/ "mjpc/tasks/cartpole/task.xml"
/ "build/mjpc/tasks/cartpole/task.xml"
)
model = mujoco.MjModel.from_xml_path(str(model_path))

Expand All @@ -271,7 +271,7 @@ def test_set_cost_weights(self):
def test_get_cost_weights(self):
model_path = (
pathlib.Path(__file__).parent.parent.parent
/ "mjpc/tasks/cartpole/task.xml"
/ "build/mjpc/tasks/cartpole/task.xml"
)
model = mujoco.MjModel.from_xml_path(str(model_path))

Expand Down Expand Up @@ -310,7 +310,7 @@ def test_get_cost_weights(self):
def test_set_state_with_lists(self):
model_path = (
pathlib.Path(__file__).parent.parent.parent
/ "mjpc/tasks/particle/task_timevarying.xml"
/ "build/mjpc/tasks/particle/task_timevarying.xml"
)
model = mujoco.MjModel.from_xml_path(str(model_path))
data = mujoco.MjData(model)
Expand All @@ -330,7 +330,7 @@ def test_set_state_with_lists(self):
def test_get_set_default_mode(self):
model_path = (
pathlib.Path(__file__).parent.parent.parent
/ "mjpc/tasks/cartpole/task.xml"
/ "build/mjpc/tasks/cartpole/task.xml"
)
model = mujoco.MjModel.from_xml_path(str(model_path))
with agent_lib.Agent(task_id="Cartpole", model=model) as agent:
Expand All @@ -341,7 +341,7 @@ def test_get_set_default_mode(self):
def test_get_set_mode(self):
model_path = (
pathlib.Path(__file__).parent.parent.parent
/ "mjpc/tasks/quadruped/task_flat.xml"
/ "build/mjpc/tasks/quadruped/task_flat.xml"
)
model = mujoco.MjModel.from_xml_path(str(model_path))
with agent_lib.Agent(task_id="Quadruped Flat", model=model) as agent:
Expand All @@ -352,7 +352,7 @@ def test_get_set_mode(self):
def test_get_all_modes(self):
model_path = (
pathlib.Path(__file__).parent.parent.parent
/ "mjpc/tasks/quadruped/task_flat.xml"
/ "build/mjpc/tasks/quadruped/task_flat.xml"
)
model = mujoco.MjModel.from_xml_path(str(model_path))
with agent_lib.Agent(task_id="Quadruped Flat", model=model) as agent:
Expand All @@ -365,7 +365,7 @@ def test_get_all_modes(self):
def test_set_mode_error(self):
model_path = (
pathlib.Path(__file__).parent.parent.parent
/ "mjpc/tasks/quadruped/task_flat.xml"
/ "build/mjpc/tasks/quadruped/task_flat.xml"
)
model = mujoco.MjModel.from_xml_path(str(model_path))
with agent_lib.Agent(task_id="Quadruped Flat", model=model) as agent:
Expand All @@ -374,7 +374,7 @@ def test_set_mode_error(self):
def test_set_task_parameters_from_another_agent(self):
model_path = (
pathlib.Path(__file__).parent.parent.parent
/ "mjpc/tasks/cartpole/task.xml"
/ "build/mjpc/tasks/cartpole/task.xml"
)
model = mujoco.MjModel.from_xml_path(str(model_path))
with agent_lib.Agent(task_id="Cartpole", model=model) as agent:
Expand All @@ -393,7 +393,7 @@ def test_set_task_parameters_from_another_agent(self):
def test_best_trajectory(self):
model_path = (
pathlib.Path(__file__).parent.parent.parent
/ "mjpc/tasks/particle/task_timevarying.xml"
/ "build/mjpc/tasks/particle/task_timevarying.xml"
)
model = mujoco.MjModel.from_xml_path(str(model_path))
data = mujoco.MjData(model)
Expand All @@ -418,7 +418,7 @@ def test_best_trajectory(self):
def test_set_mocap(self):
model_path = (
pathlib.Path(__file__).parent.parent.parent
/ "mjpc/tasks/particle/task_timevarying.xml"
/ "build/mjpc/tasks/particle/task_timevarying.xml"
)
model = mujoco.MjModel.from_xml_path(str(model_path))
with agent_lib.Agent(task_id="ParticleFixed", model=model) as agent:
Expand Down

0 comments on commit dd6618d

Please sign in to comment.