Fawkes API
Fawkes Development Version
|
OpenRAVE Robot class. More...
#include <>>
Public Member Functions | |
OpenRaveRobot (fawkes::Logger *logger=0) | |
Constructor. | |
OpenRaveRobot (const std::string &filename, fawkes::OpenRaveEnvironment *env, fawkes::Logger *logger=0) | |
Constructor. | |
virtual | ~OpenRaveRobot () |
Destructor. | |
virtual void | load (const std::string &filename, fawkes::OpenRaveEnvironment *env) |
Load robot from xml file. | |
virtual void | set_ready () |
Set robot ready for usage. | |
virtual void | set_offset (float trans_x, float trans_y, float trans_z) |
Directly set transition offset between coordinate systems of real device and OpenRAVE model. | |
virtual void | calibrate (float device_trans_x, float device_trans_y, float device_trans_z) |
Calculate transition offset between coordinate systems of real device and OpenRAVE model. | |
virtual void | set_manipulator (fawkes::OpenRaveManipulator *manip, bool display_movements=false) |
Set pointer to OpenRaveManipulator object. | |
virtual void | update_manipulator () |
Update motor values from OpenRAVE model. | |
virtual void | update_model () |
Update/Set OpenRAVE motor angles. | |
virtual bool | attach_object (OpenRAVE::KinBodyPtr object) |
Attach a kinbody to the robot. | |
virtual bool | attach_object (const std::string &name, fawkes::OpenRaveEnvironment *env) |
Attach a kinbody to the robot. | |
virtual bool | release_object (OpenRAVE::KinBodyPtr object) |
Release a kinbody from the robot. | |
virtual bool | release_object (const std::string &name, fawkes::OpenRaveEnvironment *env) |
Release a kinbody from the robot. | |
virtual bool | release_all_objects () |
Release all grabbed kinbodys from the robot. | |
virtual bool | set_target_rel (float trans_x, float trans_y, float trans_z, bool is_extension=false) |
Set target, given relative transition. | |
virtual bool | set_target_straight (float trans_x, float trans_y, float trans_z) |
Set target for a straight movement, given transition. | |
virtual bool | set_target_quat (float trans_x, float trans_y, float trans_z, float quat_w, float quat_x, float quat_y, float quat_z, bool no_offset=false) |
Set target, given transition, and rotation as quaternion. | |
virtual bool | set_target_axis_angle (float trans_x, float trans_y, float trans_z, float angle, float axisX, float axisY, float axisZ, bool no_offset=false) |
Set target, given transition, and rotation as axis-angle. | |
virtual bool | set_target_euler (euler_rotation_t type, float trans_x, float trans_y, float trans_z, float phi, float theta, float psi, bool no_offset=false) |
Set target, given transition, and Euler-rotation. | |
virtual bool | set_target_ikparam (OpenRAVE::IkParameterization ik_param) |
Set target by giving IkParameterizaion of target. | |
virtual void | set_target_plannerparams (std::string ¶ms) |
Set additional planner parameters. | |
virtual void | set_target_angles (std::vector< float > &angles) |
Set target angles directly. | |
virtual bool | set_target_object_position (float trans_x, float trans_y, float trans_z, float rot_x) |
Set target by giving position of an object. | |
virtual OpenRAVE::RobotBasePtr | get_robot_ptr () const |
Returns RobotBasePtr for uses in other classes. | |
virtual target_t | get_target () const |
Get target. | |
virtual OpenRaveManipulator * | get_manipulator () const |
Get manipulator. | |
virtual OpenRAVE::PlannerBase::PlannerParametersPtr | get_planner_params () const |
Updates planner parameters and return pointer to it. | |
virtual std::vector < std::vector< OpenRAVE::dReal > > * | get_trajectory () const |
Return pointer to trajectory of motion from __manip to __target.manip with OpenRAVE-model angle format. | |
virtual std::vector < std::vector< float > > * | get_trajectory_device () const |
Return pointer to trajectory of motion from __manip to __target.manip with device angle format. | |
virtual bool | display_planned_movements () const |
Getter for __display_planned_movements. | |
virtual OpenRAVE::ModuleBasePtr | get_basemanip () const |
Return BaseManipulation Module-Pointer. |
OpenRAVE Robot class.
Class handling interaction with the OpenRAVE::RobotBase class.
This class mainly handles robot specific tasks, like setting a target, looking for IK solutions and handling planning parameters for the robot.
fawkes::OpenRaveRobot::OpenRaveRobot | ( | fawkes::Logger * | logger = 0 | ) |
fawkes::OpenRaveRobot::OpenRaveRobot | ( | const std::string & | filename, |
fawkes::OpenRaveEnvironment * | env, | ||
fawkes::Logger * | logger = 0 |
||
) |
Constructor.
filename | path to robot's xml file |
env | pointer to OpenRaveEnvironment object |
logger | pointer to fawkes logger |
Definition at line 60 of file robot.cpp.
References load().
fawkes::OpenRaveRobot::~OpenRaveRobot | ( | ) | [virtual] |
Destructor.
Definition at line 70 of file robot.cpp.
References fawkes::target_t::manip, and fawkes::Logger::log_warn().
bool fawkes::OpenRaveRobot::attach_object | ( | OpenRAVE::KinBodyPtr | object | ) | [virtual] |
Attach a kinbody to the robot.
object | KinbodyPtr of object to be attached |
Definition at line 572 of file robot.cpp.
References fawkes::Logger::log_warn().
Referenced by OpenRaveThread::attach_object(), and attach_object().
bool fawkes::OpenRaveRobot::attach_object | ( | const std::string & | name, |
fawkes::OpenRaveEnvironment * | env | ||
) | [virtual] |
Attach a kinbody to the robot.
name | name of the object |
env | pointer to OpenRaveEnvironment object |
Definition at line 591 of file robot.cpp.
References fawkes::OpenRaveEnvironment::get_env_ptr(), and attach_object().
void fawkes::OpenRaveRobot::calibrate | ( | float | device_trans_x, |
float | device_trans_y, | ||
float | device_trans_z | ||
) | [virtual] |
Calculate transition offset between coordinate systems of real device and OpenRAVE model.
Sets model's angles to current device's angles (from __manip), and compares transitions.
device_trans_x | transition on x-axis (real device) |
device_trans_y | transition on y-axis (real device) |
device_trans_z | transition on z-axis (real device) |
Definition at line 177 of file robot.cpp.
References fawkes::OpenRaveManipulator::get_angles().
Referenced by OpenRaveThread::set_manipulator().
bool fawkes::OpenRaveRobot::display_planned_movements | ( | ) | const [virtual] |
Getter for __display_planned_movements.
Definition at line 234 of file robot.cpp.
Referenced by fawkes::OpenRaveEnvironment::run_planner(), and fawkes::OpenRaveEnvironment::run_graspplanning().
OpenRAVE::ModuleBasePtr fawkes::OpenRaveRobot::get_basemanip | ( | ) | const [virtual] |
Return BaseManipulation Module-Pointer.
Definition at line 560 of file robot.cpp.
Referenced by fawkes::OpenRaveEnvironment::run_planner().
OpenRaveManipulator * fawkes::OpenRaveRobot::get_manipulator | ( | ) | const [virtual] |
Get manipulator.
OpenRAVE::PlannerBase::PlannerParametersPtr fawkes::OpenRaveRobot::get_planner_params | ( | ) | const [virtual] |
Updates planner parameters and return pointer to it.
Definition at line 516 of file robot.cpp.
References fawkes::OpenRaveManipulator::get_angles(), and fawkes::target_t::manip.
Referenced by fawkes::OpenRaveEnvironment::run_planner().
OpenRAVE::RobotBasePtr fawkes::OpenRaveRobot::get_robot_ptr | ( | ) | const [virtual] |
Returns RobotBasePtr for uses in other classes.
Definition at line 489 of file robot.cpp.
Referenced by fawkes::OpenRaveEnvironment::add_robot(), fawkes::OpenRaveEnvironment::load_IK_solver(), fawkes::OpenRaveEnvironment::run_planner(), fawkes::OpenRaveEnvironment::run_graspplanning(), and fawkes::OpenRaveEnvironment::move_object().
target_t fawkes::OpenRaveRobot::get_target | ( | ) | const [virtual] |
Get target.
Definition at line 498 of file robot.cpp.
Referenced by fawkes::OpenRaveEnvironment::run_planner().
std::vector< std::vector< dReal > > * fawkes::OpenRaveRobot::get_trajectory | ( | ) | const [virtual] |
Return pointer to trajectory of motion from __manip to __target.manip with OpenRAVE-model angle format.
Definition at line 532 of file robot.cpp.
Referenced by fawkes::OpenRaveEnvironment::run_planner(), and fawkes::OpenRaveEnvironment::run_graspplanning().
std::vector< std::vector< float > > * fawkes::OpenRaveRobot::get_trajectory_device | ( | ) | const [virtual] |
Return pointer to trajectory of motion from __manip to __target.manip with device angle format.
Definition at line 542 of file robot.cpp.
References fawkes::OpenRaveManipulator::angles_or_to_device().
void fawkes::OpenRaveRobot::load | ( | const std::string & | filename, |
fawkes::OpenRaveEnvironment * | env | ||
) | [virtual] |
Load robot from xml file.
filename | path to robot's xml file |
env | pointer to OpenRaveEnvironment object |
Definition at line 102 of file robot.cpp.
References fawkes::OpenRaveEnvironment::get_env_ptr(), and fawkes::Logger::log_debug().
Referenced by OpenRaveThread::add_robot(), and OpenRaveRobot().
bool fawkes::OpenRaveRobot::release_all_objects | ( | ) | [virtual] |
Release all grabbed kinbodys from the robot.
Definition at line 632 of file robot.cpp.
References fawkes::Logger::log_warn().
Referenced by OpenRaveThread::release_all_objects().
bool fawkes::OpenRaveRobot::release_object | ( | OpenRAVE::KinBodyPtr | object | ) | [virtual] |
Release a kinbody from the robot.
object | KinbodyPtr of object to be released |
Definition at line 603 of file robot.cpp.
References fawkes::Logger::log_warn().
Referenced by OpenRaveThread::release_object(), and release_object().
bool fawkes::OpenRaveRobot::release_object | ( | const std::string & | name, |
fawkes::OpenRaveEnvironment * | env | ||
) | [virtual] |
Release a kinbody from the robot.
name | name of the object |
env | pointer to OpenRaveEnvironment object |
Definition at line 621 of file robot.cpp.
References fawkes::OpenRaveEnvironment::get_env_ptr(), and release_object().
void fawkes::OpenRaveRobot::set_manipulator | ( | fawkes::OpenRaveManipulator * | manip, |
bool | display_movements = false |
||
) | [virtual] |
Set pointer to OpenRaveManipulator object.
Make sure this is called AFTER all manipulator settings have been set (assures that __target.manip has the same settings).
manip | pointer to OpenRaveManipulator object |
display_movements | true, if movements should be displayed in viewer. Better be "false" if want to sync OpenRAVE models with device |
Definition at line 201 of file robot.cpp.
References fawkes::target_t::manip.
Referenced by OpenRaveThread::set_manipulator().
void fawkes::OpenRaveRobot::set_offset | ( | float | trans_x, |
float | trans_y, | ||
float | trans_z | ||
) | [virtual] |
Directly set transition offset between coordinate systems of real device and OpenRAVE model.
trans_x | transition offset on x-axis |
trans_y | transition offset on y-axis |
trans_z | transition offset on z-axis |
Definition at line 161 of file robot.cpp.
Referenced by OpenRaveThread::set_manipulator().
void fawkes::OpenRaveRobot::set_ready | ( | ) | [virtual] |
Set robot ready for usage.
Here: Set active DOFs and create plannerParameters. CAUTION: Only successful after added to environment. Otherwise no active DOF will be recognized.
Definition at line 118 of file robot.cpp.
References fawkes::Logger::log_debug().
Referenced by OpenRaveThread::add_robot().
void fawkes::OpenRaveRobot::set_target_angles | ( | std::vector< float > & | angles | ) | [virtual] |
Set target angles directly.
angles | vector with angle values |
Definition at line 476 of file robot.cpp.
References fawkes::target_t::manip, and fawkes::OpenRaveManipulator::set_angles().
bool fawkes::OpenRaveRobot::set_target_axis_angle | ( | float | trans_x, |
float | trans_y, | ||
float | trans_z, | ||
float | angle, | ||
float | axisX, | ||
float | axisY, | ||
float | axisZ, | ||
bool | no_offset = false |
||
) | [virtual] |
Set target, given transition, and rotation as axis-angle.
trans_x | x-transition |
trans_y | y-transition |
trans_z | z-transition |
angle | axis-angle angle |
axisX | axis-angle x-axis value |
axisY | axis-angle y-axis value |
axisZ | axis-angle z-axis value |
no_offset | if true, do not include manipulator offset (default: false) |
bool fawkes::OpenRaveRobot::set_target_euler | ( | euler_rotation_t | type, |
float | trans_x, | ||
float | trans_y, | ||
float | trans_z, | ||
float | phi, | ||
float | theta, | ||
float | psi, | ||
bool | no_offset = false |
||
) | [virtual] |
Set target, given transition, and Euler-rotation.
type | Euler-rotation type (ZXZ, ZYZ, ...) |
trans_x | x-transition |
trans_y | y-transition |
trans_z | z-transition |
phi | 1st rotation |
theta | 2nd rotation |
psi | 3rd rotation |
no_offset | if true, do not include manipulator offset (default: false) |
Definition at line 339 of file robot.cpp.
References fawkes::EULER_ZXZ, fawkes::Logger::log_debug(), fawkes::EULER_ZYZ, fawkes::EULER_ZYX, fawkes::target_t::type, fawkes::TARGET_NONE, and fawkes::target_t::solvable.
bool fawkes::OpenRaveRobot::set_target_ikparam | ( | OpenRAVE::IkParameterization | ik_param | ) | [virtual] |
Set target by giving IkParameterizaion of target.
OpenRAVE::IkParameterization is the desired type to be calculated with by OpenRAVE. Each oter type (i.e. Transform) is implicitly transformed to an IkParameterization before continuing to check for Ik solution and planning, i.e. by the BaseManipulation module.
ik_param | the OpenRAVE::IkParameterization of the target |
Definition at line 444 of file robot.cpp.
References fawkes::target_t::ikparam, fawkes::target_t::type, fawkes::TARGET_IKPARAM, fawkes::target_t::solvable, fawkes::target_t::manip, and fawkes::OpenRaveManipulator::set_angles().
bool fawkes::OpenRaveRobot::set_target_object_position | ( | float | trans_x, |
float | trans_y, | ||
float | trans_z, | ||
float | rot_x | ||
) | [virtual] |
Set target by giving position of an object.
Currently the object should be cylindric, and stand upright. It may also be rotated on its x-axis, but that rotation needs to be given in an argument to calculate correct position for end-effector. This is only temporary until proper grasp planning for 5DOF in OpenRAVE is provided.
trans_x | x-transition of object |
trans_y | y-transition of object |
trans_z | z-transition of object |
rot_x | rotation of object on x-axis (radians) (default: 0.f, i.e. upright) |
Definition at line 386 of file robot.cpp.
Referenced by OpenRaveThread::set_target_object().
void fawkes::OpenRaveRobot::set_target_plannerparams | ( | std::string & | params | ) | [virtual] |
Set additional planner parameters.
BaseManipulation module accepts many arguments that can be passed. Planner parameters can be important to plan a path according to ones needs, e.g. set deviations, optimizer iterations, etc. Do not mistake it with the single argument "plannerparams" of BaseManipulation.
params | complete string of additional arguments. |
Definition at line 466 of file robot.cpp.
References fawkes::target_t::plannerparams.
bool fawkes::OpenRaveRobot::set_target_quat | ( | float | trans_x, |
float | trans_y, | ||
float | trans_z, | ||
float | quat_w, | ||
float | quat_x, | ||
float | quat_y, | ||
float | quat_z, | ||
bool | no_offset = false |
||
) | [virtual] |
Set target, given transition, and rotation as quaternion.
trans_x | x-transition |
trans_y | y-transition |
trans_z | z-transition |
quat_w | quaternion skalar |
quat_x | quaternion 1st value |
quat_y | quaternion 2nd value |
quat_z | quaternion 3rd value |
no_offset | if true, do not include manipulator offset (default: false) |
bool fawkes::OpenRaveRobot::set_target_rel | ( | float | trans_x, |
float | trans_y, | ||
float | trans_z, | ||
bool | is_extension = false |
||
) | [virtual] |
Set target, given relative transition.
This is the prefered method to set a target for straight manipulator movement.
trans_x | x-transition |
trans_y | y-transition |
trans_z | z-transition |
is_extension | true, if base coordination system lies in arm extension |
Definition at line 248 of file robot.cpp.
References fawkes::target_t::type, fawkes::TARGET_RELATIVE_EXT, fawkes::TARGET_RELATIVE, fawkes::target_t::x, fawkes::target_t::y, fawkes::target_t::z, and fawkes::target_t::solvable.
Referenced by set_target_straight().
bool fawkes::OpenRaveRobot::set_target_straight | ( | float | trans_x, |
float | trans_y, | ||
float | trans_z | ||
) | [virtual] |
Set target for a straight movement, given transition.
This is the a wrapper for "set_target_rel", to be able to call for a straight arm movement by giving non-relative transition.
trans_x | x-transition |
trans_y | y-transition |
trans_z | z-transition |
Definition at line 275 of file robot.cpp.
References set_target_rel().
void fawkes::OpenRaveRobot::update_manipulator | ( | ) | [virtual] |
Update motor values from OpenRAVE model.
Can be used to sync real device with OpenRAVE model
Definition at line 212 of file robot.cpp.
References fawkes::OpenRaveManipulator::set_angles().
void fawkes::OpenRaveRobot::update_model | ( | ) | [virtual] |
Update/Set OpenRAVE motor angles.
Definition at line 222 of file robot.cpp.
References fawkes::OpenRaveManipulator::get_angles().