Skip to content

Commit

Permalink
updated readme and rosinstall
Browse files Browse the repository at this point in the history
  • Loading branch information
ichumuh committed Oct 27, 2021
1 parent e062cbb commit 1ed764c
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 72 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# giskardpy
The core python library of the Giskard framework for constraint- and optimization-based robot motion control.

## Installation instructions. Tested with Ubuntu 18.04 + melodic and 20.04 + Noetic
## Installation instructions. Tested with Ubuntu 20.04 + Noetic

Install the following python packages. When using 20.04, just install the latest version of everything and use pip3:
Do this:
```
sudo pip install pybullet
sudo pip install scipy==1.2.2 # this is the last version for python 2.7
sudo pip install casadi
sudo pip install sortedcontainers
sudo pip install hypothesis==4.34.0 # only needed if you want to run tests
sudo pip install pandas==0.24.2
sudo pip install numpy==1.16
sudo pip3 install pybullet
sudo pip3 install scipy
sudo pip3 install casadi
sudo pip3 install sortedcontainers
sudo pip3 install hypothesis
sudo pip3 install pandas
sudo pip3 install numpy
sudo apt install python3-dev
```
Install one of the following QP solver. The solvers are ordered by how fast they can solve the problem constructed by Giskard. QPOases is the fastest opensource solver for my usecase, that I have found. However, it is still significantly slower than the other two options:
Expand Down
12 changes: 0 additions & 12 deletions rosinstall/melodic.rosinstall

This file was deleted.

4 changes: 2 additions & 2 deletions rosinstall/noetic.rosinstall
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
- git:
local-name: giskardpy
uri: https://github.com/SemRoCo/giskardpy.git
version: mpc
version: model_update
- git:
local-name: giskard_msgs
uri: https://github.com/SemRoCo/giskard_msgs.git
version: master
version: model_update
8 changes: 0 additions & 8 deletions src/giskardpy/goals/collision_avoidance.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,14 +196,6 @@ def make_constraints(self):
1e4,
w.max(0, upper_slack))

self.add_debug_expr('actual_distance', actual_distance)
self.add_debug_expr('dist', dist)
self.add_debug_vector('a_P_pa', a_P_pa)
self.add_debug_vector('pb_V_n', pb_V_n)
self.add_debug_vector('pb_P_b', w.position_of(pb_T_b))
self.add_debug_vector('pb_P_pa', pb_P_pa)
self.add_debug_matrix('b_T_a', b_T_a)

self.add_constraint(reference_velocity=self.max_velocity,
lower_error=lower_limit,
upper_error=100,
Expand Down
1 change: 0 additions & 1 deletion src/giskardpy/goals/joint_goals.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ def make_constraints(self):
self.world.joint_limit_expr(self.joint_name, 1)[1])

error = joint_goal - current_joint

self.add_constraint(reference_velocity=max_velocity,
lower_error=error,
upper_error=error,
Expand Down
41 changes: 1 addition & 40 deletions src/giskardpy/goals/pointing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@

from geometry_msgs.msg import Vector3Stamped

import giskardpy.identifier as identifier
from giskardpy import casadi_wrapper as w
from giskardpy.goals.goal import Goal, WEIGHT_BELOW_CA
import giskardpy.utils.tfwrapper as tf

class Pointing(Goal):

class Pointing(Goal):
def __init__(self, tip_link, goal_point, root_link, pointing_axis=None, max_velocity=0.3,
weight=WEIGHT_BELOW_CA, **kwargs):
"""
Expand All @@ -34,58 +33,20 @@ def __init__(self, tip_link, goal_point, root_link, pointing_axis=None, max_velo
self.tip_V_pointing_axis.header.frame_id = self.tip
self.tip_V_pointing_axis.vector.z = 1


def make_constraints(self):
# TODO fix comments
# in this function, you have to create the actual constraints
# start by creating references to your input params in the god map
# get_input functions generally return symbols referring to god map entries
root_T_tip = self.get_fk(self.root, self.tip)
root_P_goal_point = self.get_parameter_as_symbolic_expression(u'root_P_goal_point')
tip_V_pointing_axis = self.get_parameter_as_symbolic_expression(u'tip_V_pointing_axis')

# do some math to create your expressions and limits
# make sure to always use function from the casadi_wrapper, here imported as "w".
# here are some rules of thumb that often make constraints more stable:
# 1) keep the expressions as simple as possible and move the "magic" into the lower/upper limits
# 2) don't try to minimize the number of constraints (in this example, minimizing the angle is also possible
# but sometimes gets unstable)
# 3) you can't use the normal if! use e.g. "w.if_eq"
# 4) use self.limit_velocity on your error
# 5) giskard will calculate the derivative of "expression". so in this example, writing -diff[0] in
# in expression will result in the same behavior, because goal_axis is constant.
# This is also the reason, why lower/upper are limits for the derivative.
root_V_goal_axis = root_P_goal_point - w.position_of(root_T_tip)
root_V_goal_axis /= w.norm(root_V_goal_axis) # FIXME avoid /0
root_V_pointing_axis = w.dot(root_T_tip, tip_V_pointing_axis)

# add constraints to the current problem, after execution, it gets cleared automatically
self.add_vector_goal_constraints(frame_V_current=root_V_pointing_axis,
frame_V_goal=root_V_goal_axis,
reference_velocity=self.max_velocity,
weight=self.weight)
# self.add_constraint(
# u'x',
# reference_velocity=max_velocity,
# lower_error=diff[0],
# upper_error=diff[0],
# weight=weight,
# expression=current_axis[0])
#
# self.add_constraint(u'y',
# reference_velocity=max_velocity,
# lower_error=diff[1],
# upper_error=diff[1],
# weight=weight,
# expression=current_axis[1])
# self.add_constraint(u'z',
# reference_velocity=max_velocity,
# lower_error=diff[2],
# upper_error=diff[2],
# weight=weight,
# expression=current_axis[2])

def __str__(self):
# helps to make sure your constraint name is unique.
s = super(Pointing, self).__str__()
return u'{}/{}/{}'.format(s, self.root, self.tip)

0 comments on commit 1ed764c

Please sign in to comment.