Skip to content

Commit c11ad89

Browse files
authored
Merge pull request #9 from Arena-Rosnav/master
Master
2 parents 1af3a40 + 7669886 commit c11ad89

20 files changed

+406
-203
lines changed

agents/jackal_marl/best_model.zip

18 MB
Binary file not shown.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"agent_name": "AGENT_24_2022_02_04__11_28",
3+
"robot": "jackal",
4+
"actions_in_observationspace": true,
5+
"reward_fnc": "rule_06",
6+
"discrete_action_space": false,
7+
"normalize": false,
8+
"task_mode": "staged",
9+
"train_max_steps_per_episode": 400,
10+
"eval_max_steps_per_episode": 1100,
11+
"goal_radius": 0.7,
12+
"curr_stage": 1,
13+
"batch_size": 38400,
14+
"gamma": 0.99,
15+
"n_steps": 3200,
16+
"ent_coef": 0.005,
17+
"learning_rate": 0.0003,
18+
"vf_coef": 0.22,
19+
"max_grad_norm": 0.5,
20+
"gae_lambda": 0.95,
21+
"m_batch_size": 15,
22+
"n_epochs": 3,
23+
"clip_range": 0.22,
24+
"observation_space": ["laser_scan", "goal_in_robot_frame", "last_action"]
25+
}
Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
11
{
2-
"agent_name": "AGENT_24_2022_02_04__11_28",
3-
"robot": "jackal",
4-
"actions_in_observationspace": true,
5-
"reward_fnc": "rule_05",
6-
"discrete_action_space": false,
7-
"normalize": false,
8-
"task_mode": "staged",
9-
"train_max_steps_per_episode": 150,
10-
"eval_max_steps_per_episode": 200,
11-
"goal_radius": 0.7,
12-
"curr_stage": 8,
13-
"batch_size": 19200,
14-
"gamma": 0.99,
15-
"n_steps": 4800,
16-
"ent_coef": 0.005,
17-
"learning_rate": 0.0003,
18-
"vf_coef": 0.22,
19-
"max_grad_norm": 0.5,
20-
"gae_lambda": 0.95,
21-
"m_batch_size": 15,
22-
"n_epochs": 3,
23-
"clip_range": 0.22
24-
}
2+
"agent_name": "AGENT_24_2022_02_04__11_28",
3+
"robot": "jackal",
4+
"actions_in_observationspace": true,
5+
"reward_fnc": "rule_05",
6+
"discrete_action_space": false,
7+
"normalize": false,
8+
"task_mode": "staged",
9+
"train_max_steps_per_episode": 150,
10+
"eval_max_steps_per_episode": 200,
11+
"goal_radius": 0.7,
12+
"curr_stage": 8,
13+
"batch_size": 19200,
14+
"gamma": 0.99,
15+
"n_steps": 4800,
16+
"ent_coef": 0.005,
17+
"learning_rate": 0.0003,
18+
"vf_coef": 0.22,
19+
"max_grad_norm": 0.5,
20+
"gae_lambda": 0.95,
21+
"m_batch_size": 15,
22+
"n_epochs": 3,
23+
"clip_range": 0.22,
24+
"observation_space": ["laser_scan", "goal_in_robot_frame", "last_action"]
25+
}
17.7 MB
Binary file not shown.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"agent_name": "ridgeback_2022_09_20__15_37",
3+
"robot": "myrobot",
4+
"actions_in_observationspace": true,
5+
"reward_fnc": "rule_06",
6+
"discrete_action_space": false,
7+
"normalize": false,
8+
"task_mode": "staged",
9+
"train_max_steps_per_episode": 800,
10+
"eval_max_steps_per_episode": 1100,
11+
"goal_radius": 0.7,
12+
"curr_stage": 1,
13+
"batch_size": 57600,
14+
"gamma": 0.99,
15+
"n_steps": 4800,
16+
"ent_coef": 0.005,
17+
"learning_rate": 0.0003,
18+
"vf_coef": 0.22,
19+
"max_grad_norm": 0.5,
20+
"gae_lambda": 0.95,
21+
"m_batch_size": 16,
22+
"n_epochs": 3,
23+
"clip_range": 0.22,
24+
"observation_space": ["laser_scan", "goal_in_robot_frame", "last_action"]
25+
}
Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
11
{
2-
"agent_name": "AGENT_24_2022_02_04__11_36",
3-
"robot": "rto_real",
4-
"actions_in_observationspace": true,
5-
"reward_fnc": "rule_05",
6-
"discrete_action_space": false,
7-
"normalize": false,
8-
"task_mode": "staged",
9-
"train_max_steps_per_episode": 120,
10-
"eval_max_steps_per_episode": 170,
11-
"goal_radius": 0.7,
12-
"curr_stage": 10,
13-
"batch_size": 19200,
14-
"gamma": 0.99,
15-
"n_steps": 2400,
16-
"ent_coef": 0.005,
17-
"learning_rate": 0.0003,
18-
"vf_coef": 0.22,
19-
"max_grad_norm": 0.5,
20-
"gae_lambda": 0.95,
21-
"m_batch_size": 15,
22-
"n_epochs": 3,
23-
"clip_range": 0.22
24-
}
2+
"agent_name": "AGENT_24_2022_02_04__11_36",
3+
"robot": "rto_real",
4+
"actions_in_observationspace": true,
5+
"reward_fnc": "rule_05",
6+
"discrete_action_space": false,
7+
"normalize": false,
8+
"task_mode": "staged",
9+
"train_max_steps_per_episode": 120,
10+
"eval_max_steps_per_episode": 170,
11+
"goal_radius": 0.7,
12+
"curr_stage": 10,
13+
"batch_size": 19200,
14+
"gamma": 0.99,
15+
"n_steps": 2400,
16+
"ent_coef": 0.005,
17+
"learning_rate": 0.0003,
18+
"vf_coef": 0.22,
19+
"max_grad_norm": 0.5,
20+
"gae_lambda": 0.95,
21+
"m_batch_size": 15,
22+
"n_epochs": 3,
23+
"clip_range": 0.22,
24+
"observation_space": ["laser_scan", "goal_in_robot_frame", "last_action"]
25+
}
13.8 MB
Binary file not shown.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"agent_name": "AGENT_24_2022_02_04__11_36",
3+
"robot": "rto_real",
4+
"actions_in_observationspace": true,
5+
"reward_fnc": "rule_06",
6+
"discrete_action_space": false,
7+
"normalize": false,
8+
"task_mode": "staged",
9+
"train_max_steps_per_episode": 400,
10+
"eval_max_steps_per_episode": 1100,
11+
"goal_radius": 0.7,
12+
"curr_stage": 1,
13+
"batch_size": 38400,
14+
"gamma": 0.99,
15+
"n_steps": 3200,
16+
"ent_coef": 0.005,
17+
"learning_rate": 0.0003,
18+
"vf_coef": 0.22,
19+
"max_grad_norm": 0.5,
20+
"gae_lambda": 0.95,
21+
"m_batch_size": 15,
22+
"n_epochs": 3,
23+
"clip_range": 0.22,
24+
"observation_space": ["laser_scan", "goal_in_robot_frame", "last_action"]
25+
}

rosnav/model/agent_factory.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,23 @@ def inner_wrapper(wrapped_class) -> Callable:
4040
# end register()
4141

4242
@classmethod
43-
def instantiate(cls, name: str, **kwargs) -> Union[Type[BaseAgent], Type[BasePolicy]]:
43+
def instantiate(
44+
cls, name: str, **kwargs
45+
) -> Union[Type[BaseAgent], Type[BasePolicy]]:
4446
"""Factory command to create the agent.
4547
This method gets the appropriate agent class from the registry
4648
and creates an instance of it, while passing in the parameters
4749
given in ``kwargs``.
4850
4951
Args:
50-
name (str): The name of the agent to create.
52+
name (str): The name of the agent to create.agent_class
5153
5254
Returns:
5355
An instance of the agent that is created.
5456
"""
5557
assert name in cls.registry, f"Agent '{name}' is not registered!"
5658
agent_class = cls.registry[name]
57-
59+
5860
if issubclass(agent_class, BaseAgent):
5961
return agent_class(**kwargs)
6062
else:

rosnav/model/base_agent.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
from typing import Type, List
2-
31
from abc import ABC, abstractmethod
42
from enum import Enum
5-
from torch.nn.modules.module import Module
3+
from typing import List, Type
4+
65
from stable_baselines3.common.torch_layers import BaseFeaturesExtractor
6+
from torch.nn.modules.module import Module
77

88

99
class PolicyType(Enum):
@@ -47,14 +47,17 @@ def activation_fn(self) -> Type[Module]:
4747
pass
4848

4949
def get_kwargs(self):
50+
fe_kwargs = self.features_extractor_kwargs
51+
fe_kwargs["robot_model"] = self.robot_model
52+
5053
kwargs = {
5154
"features_extractor_class": self.features_extractor_class,
52-
"features_extractor_kwargs": self.features_extractor_kwargs,
55+
"features_extractor_kwargs": fe_kwargs,
5356
"net_arch": self.net_arch,
5457
"activation_fn": self.activation_fn,
5558
}
56-
if not kwargs['features_extractor_class']:
57-
del kwargs['features_extractor_class']
58-
if not kwargs['features_extractor_kwargs']:
59-
del kwargs['features_extractor_kwargs']
59+
if not kwargs["features_extractor_class"]:
60+
del kwargs["features_extractor_class"]
61+
if not kwargs["features_extractor_kwargs"]:
62+
del kwargs["features_extractor_kwargs"]
6063
return kwargs

0 commit comments

Comments
 (0)