Skip to content
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
10 changes: 5 additions & 5 deletions examples/boxer_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,11 @@ def run(self):
# ---END: Visualizations---

def check_goal_reaching(self, ob):
primary_goal = self._goal.primary_goal()
goal_dist = np.linalg.norm(ob['robot_0']['joint_state']['position'][:2] - primary_goal.position()) # todo remove hard coded dimension, replace it with fk instead
if goal_dist <= primary_goal.epsilon():
return True
return False
primary_goal = self._goal.primary_goal()
goal_dist = np.linalg.norm(ob['robot_0']['joint_state']['position'][:2] - primary_goal.position()) # todo remove hard coded dimension, replace it with fk instead
if goal_dist <= primary_goal.epsilon():
return True
return False

def main():
boxer_example = BoxerMpcExample(sys.argv[1])
Expand Down
2 changes: 1 addition & 1 deletion examples/config/boxerMpc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ mpc:
- 'GoalReaching'
- 'ConstraintAvoidance'
weights:
w: 1.0
wgoal: 1.0
wvel: [0.0, 0.0, 0.0, 1, 0.01]
ws: 1e10
wu: 0.01
Expand Down
2 changes: 1 addition & 1 deletion robotmpcs/models/inequalities/RadialConstraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ def set_parameters(self, ParamMap, npar):


def eval_constraint(self, z, p):
ineqs = self.eval_obstacleDistances(z,p,j)
ineqs = self.eval_obstacleDistances(z,p)
return ineqs

4 changes: 3 additions & 1 deletion robotmpcs/planner/mpcPlanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def reset(self):
for i in range(self._config.time_horizon):
self._params[
[self._npar * i + val for val in self._paramMap["wgoal"]]
] = self._config.weights["w"]
] = self._config.weights["wgoal"]
# for j, val in enumerate(self._paramMap["wvel"]):
# self._params[[self._npar * i + val]] = self._config.weights["wvel"][j]
self._params[
Expand Down Expand Up @@ -199,8 +199,10 @@ def setGoalReaching(self, goal):
for j in range(self.m()):
if j >= len(goal.primary_goal().position()):
position = 0
print('no goal')
else:
position = goal.primary_goal().position()[j]
print('setting goal')
self._params[self._npar * i + self._paramMap["goal"][j]] = position

def setConstraintAvoidance(self):
Expand Down
1 change: 1 addition & 0 deletions ros_bridge/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Install `robot_mpcs` globally (or in the virtual environment if you use ros insi
```bash
pip install -e .
```
ira_laser_tools

Build catkin workspace
```bash
Expand Down
15 changes: 10 additions & 5 deletions ros_bridge/src/robotmpcs_ros/config/boxer_mpc_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,21 @@ mpc:
time_step: 0.1
slack: False
interval: 1
initialization: previous_plan
initialization: current_state
constraints:
- RadialConstraints
- LinearConstraints
- SelfCollisionAvoidanceConstraints
- JointLimitConstraints
- InputLimitConstraints
objectives:
- 'GoalReaching'
weights:
w: 1.0
wvel: [0.0, 0.0, 0.0, 1, 0.01]
wgoal: 1.0
wvel: [0.0, 0.0, 0.0, 0.0, 0.0]
ws: 1e10
wu: 0.01
wobst: 0.5
wobst: 0.0
wconstr: [0.0, 0.0, 0.0, 0.0]
number_obstacles: 1
control_mode: "acc"
robot:
Expand All @@ -29,3 +32,5 @@ robot:
root_link: base_link
end_link: ee_link
base_type: diffdrive
example:
debug: False
10 changes: 10 additions & 0 deletions ros_bridge/src/robotmpcs_ros/launch/lidar_merger.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<launch>

<node pkg="ira_laser_tools" name="laserscan_multi_merger" type="laserscan_multi_merger">
<param name="destination_frame" value="front_laser"/>
<param name="scan_destination_topic" value="/scan"/>
<param name="laserscan_topics" value ="/front/scan /rear/scan" />
</node>

</launch>
Loading