pr2-ikfast 0.0.1__tar.gz → 0.0.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pr2_ikfast
3
- Version: 0.0.1
3
+ Version: 0.0.2
4
4
  Summary: Python bindings for the PR2 IKFast library
5
5
  Requires-Python: >=3.8
6
6
  Requires-Dist: numpy
@@ -3,7 +3,7 @@ cpp codes are fetched from https://github.com/caelan/pybullet-planning (MIT Lice
3
3
 
4
4
  ## Installation
5
5
  ```bash
6
- pip install .
6
+ pip install pr2-ikfast
7
7
  ```
8
8
 
9
9
  ## Usage
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "pr2_ikfast"
7
- version = "0.0.1"
7
+ version = "0.0.2"
8
8
  description = "Python bindings for the PR2 IKFast library"
9
9
  requires-python = ">=3.8"
10
10
  dependencies = ["numpy"]
@@ -20,10 +20,10 @@ def solve_right_ik(trans: List[float], rot: List[float], free_vals: List[float])
20
20
 
21
21
 
22
22
  @dataclass
23
- class UnoformSampler:
23
+ class UniformSampler:
24
24
  n_size: int = 72
25
- lb: float = 0.5 * -np.pi
26
- ub: float = 0.5 * np.pi
25
+ lb: float = -np.pi
26
+ ub: float = np.pi
27
27
 
28
28
  def __call__(self) -> np.ndarray:
29
29
  return np.random.uniform(self.lb, self.ub, size=(self.n_size,))
@@ -40,13 +40,18 @@ def solve_ik(
40
40
  predicate: Optional[Callable[[np.ndarray], bool]] = None,
41
41
  ) -> Optional[np.ndarray]:
42
42
 
43
+ # use -0.051, because original cpp code is compiled wrt baes_footprint
44
+ trans_modif = [trans[0], trans[1], trans[2] - 0.051]
45
+
43
46
  if sampler is None:
44
- sampler = UnoformSampler()
47
+ sampler = UniformSampler()
45
48
  fn = solve_right_ik if is_rarm else solve_left_ik
46
49
  upper_arm_roll_joint_vals = sampler()
47
50
  for val2 in upper_arm_roll_joint_vals:
48
51
  free_vals = [torso_value, val2]
49
- retall = fn(trans, rot, free_vals)
52
+ retall = fn(trans_modif, rot, free_vals)
53
+ if retall is None:
54
+ continue
50
55
  if lb is not None and ub is not None:
51
56
  for ret in retall:
52
57
  if np.all(ret[1:] >= lb) and np.all(ret[1:] <= ub):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pr2_ikfast
3
- Version: 0.0.1
3
+ Version: 0.0.2
4
4
  Summary: Python bindings for the PR2 IKFast library
5
5
  Requires-Python: >=3.8
6
6
  Requires-Dist: numpy
File without changes
File without changes