HiroIshida / yamaopt

robotic optimal sensor placement
MIT License
0 stars 1 forks source link

yamaopt

Optimization of sensor placement considering robot forward-kinematics reachability. The ros wrapper for this package can be found in https://github.com/708yamaguchi/yamaopt_ros.

Given urdf and multiple polygons and observation point, the program determines the optimal sensor placement that maximizes the distance between the observation point and sensor, satisfying the robot's kinematic constraint.

Installation

If you use python 2.x, following installation is required to install scikit-robot.

sudo apt-get install -y libspatialindex-dev freeglut3-dev libsuitesparse-dev libblas-dev liblapack-dev
pip install scikit-build

Yamaopt can be installed by

git clone https://github.com/HiroIshida/yamaopt.git
cd yamaopt
pip install -e .

Usage

Write your own config file defining urdf_path, contorl_joint_names, endeffector_link_name. (see /config).

The typical code for yamaopt's optimization is as follows:

from yamaopt.solver import KinematicSolver, SolverConfig

config = SolverConfig.from_config_path(config_path, use_base=use_base, optframe_xyz_from_ef=[0, 0.5, 0.0])
kinsol = KinematicSolver(config)

Note that `polygon` in `example_multi.py` is a 

sol = kinsol.solve_multiple(q_init, polygons, target_obj_pos,
                            d_hover=d_hover,
                            joint_limit_margin=joint_limit_margin)
angle_vector_solution = sol.x

Demo

cd examples
python3 example_multi.py --visualize --use_base -robot pr2