Fawkes API
Fawkes Development Version
|
OpenRAVE Robot class. More...
#include <>>
Public Member Functions | |
OpenRaveRobot (fawkes::Logger *logger=0) | |
Constructor. More... | |
OpenRaveRobot (const std::string &filename, fawkes::OpenRaveEnvironmentPtr &env, fawkes::Logger *logger=0) | |
Constructor. More... | |
OpenRaveRobot (const fawkes::OpenRaveRobot &src, const fawkes::OpenRaveEnvironmentPtr &new_env) | |
Copy Constructor. More... | |
virtual | ~OpenRaveRobot () |
Destructor. More... | |
virtual void | load (const std::string &filename, fawkes::OpenRaveEnvironmentPtr &env) |
Load robot from xml file. More... | |
virtual void | set_ready () |
Set robot ready for usage. More... | |
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. More... | |
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. More... | |
virtual void | set_manipulator (fawkes::OpenRaveManipulatorPtr &manip, bool display_movements=false) |
Set pointer to OpenRaveManipulator object. More... | |
virtual void | update_manipulator () |
Update motor values from OpenRAVE model. More... | |
virtual void | update_model () |
Update/Set OpenRAVE motor angles. More... | |
virtual bool | attach_object (OpenRAVE::KinBodyPtr object, const char *manip_name=NULL) |
Attach a kinbody to the robot. More... | |
virtual bool | attach_object (const char *name, fawkes::OpenRaveEnvironmentPtr &env, const char *manip_name=NULL) |
Attach a kinbody to the robot. More... | |
virtual bool | release_object (OpenRAVE::KinBodyPtr object) |
Release a kinbody from the robot. More... | |
virtual bool | release_object (const std::string &name, fawkes::OpenRaveEnvironmentPtr &env) |
Release a kinbody from the robot. More... | |
virtual bool | release_all_objects () |
Release all grabbed kinbodys from the robot. More... | |
virtual bool | set_target_rel (float trans_x, float trans_y, float trans_z, bool is_extension=false) |
Set target, given relative transition. More... | |
virtual bool | set_target_straight (float trans_x, float trans_y, float trans_z) |
Set target for a straight movement, given transition. More... | |
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, OpenRAVE::IkFilterOptions filter=OpenRAVE::IKFO_CheckEnvCollisions, bool no_offset=false) |
Set target, given transition, and rotation as quaternion. More... | |
virtual bool | set_target_axis_angle (float trans_x, float trans_y, float trans_z, float angle, float axisX, float axisY, float axisZ, OpenRAVE::IkFilterOptions filter=OpenRAVE::IKFO_CheckEnvCollisions, bool no_offset=false) |
Set target, given transition, and rotation as axis-angle. More... | |
virtual bool | set_target_euler (euler_rotation_t type, float trans_x, float trans_y, float trans_z, float phi, float theta, float psi, OpenRAVE::IkFilterOptions filter=OpenRAVE::IKFO_CheckEnvCollisions, bool no_offset=false) |
Set target, given transition, and Euler-rotation. More... | |
virtual bool | set_target_object_position (float trans_x, float trans_y, float trans_z, float rot_x, OpenRAVE::IkFilterOptions filter=OpenRAVE::IKFO_CheckEnvCollisions) |
Set target by giving position of an object. More... | |
virtual bool | set_target_ikparam (OpenRAVE::IkParameterization ik_param, OpenRAVE::IkFilterOptions filter=OpenRAVE::IKFO_CheckEnvCollisions) |
Set target by giving IkParameterizaion of target. More... | |
virtual void | set_target_plannerparams (std::string ¶ms) |
Set additional planner parameters. More... | |
virtual void | set_target_plannerparams (const char *params) |
Set additional planner parameters. More... | |
virtual void | set_target_raw (std::string &cmd) |
Set raw command for BaseManipulation module. More... | |
virtual void | set_target_raw (const char *cmd) |
Set raw command for BaseManipulation module. More... | |
virtual void | set_target_angles (std::vector< float > &angles) |
Set target angles directly. More... | |
virtual void | enable_ik_comparison (bool enable) |
Activate/Deactive IK comparison. More... | |
virtual OpenRAVE::RobotBasePtr | get_robot_ptr () const |
Returns RobotBasePtr for uses in other classes. More... | |
virtual target_t | get_target () const |
Get target. More... | |
virtual OpenRaveManipulatorPtr | get_manipulator () const |
Get manipulator. More... | |
virtual OpenRAVE::PlannerBase::PlannerParametersPtr | get_planner_params () const |
Updates planner parameters and return pointer to it. More... | |
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. More... | |
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. More... | |
virtual bool | display_planned_movements () const |
Getter for __display_planned_movements. More... | |
virtual OpenRAVE::ModuleBasePtr | get_basemanip () const |
Return BaseManipulation Module-Pointer. More... | |
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::OpenRaveEnvironmentPtr & | 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 61 of file robot.cpp.
References load().
fawkes::OpenRaveRobot::OpenRaveRobot | ( | const fawkes::OpenRaveRobot & | src, |
const fawkes::OpenRaveEnvironmentPtr & | new_env | ||
) |
Copy Constructor.
src | The OpenRaveRobot to clone |
new_env | Pointer to the new OpenRaveEnvironment. We need this to set __robot to the correct robot in the new OpenRAVE-environment. |
Definition at line 76 of file robot.cpp.
References fawkes::OpenRaveManipulator::copy(), get_manipulator(), get_robot_ptr(), fawkes::Logger::log_debug(), fawkes::target_t::manip, and set_ready().
|
virtual |
Destructor.
Definition at line 120 of file robot.cpp.
References fawkes::Logger::log_warn(), and fawkes::target_t::manip.
|
virtual |
Attach a kinbody to the robot.
object | KinbodyPtr of object to be attached |
manip_name | name of the manipulator to attach the object to. If non given, the currently active manipulator is taken. |
Definition at line 727 of file robot.cpp.
References fawkes::Logger::log_warn().
Referenced by attach_object().
|
virtual |
Attach a kinbody to the robot.
name | name of the object |
env | pointer to OpenRaveEnvironment object |
manip_name | name of the manipulator to attach the object to |
Definition at line 764 of file robot.cpp.
References attach_object().
|
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 260 of file robot.cpp.
References fawkes::OpenRaveManipulator::get_angles().
|
virtual |
|
virtual |
Activate/Deactive IK comparison.
When activated, we don't just take the first returned IK solution, but compare them all to find the best, i.e. the one that is "closest" to our current configuration.
enable | Sets the state of the comparison. Enabled by default. |
|
virtual |
|
virtual |
Get manipulator.
Definition at line 656 of file robot.cpp.
Referenced by OpenRaveRobot().
|
virtual |
Updates planner parameters and return pointer to it.
Definition at line 665 of file robot.cpp.
References fawkes::OpenRaveManipulator::get_angles(), and fawkes::target_t::manip.
|
virtual |
Returns RobotBasePtr for uses in other classes.
Definition at line 638 of file robot.cpp.
Referenced by OpenRaveRobot().
|
virtual |
|
virtual |
|
virtual |
Return pointer to trajectory of motion from __manip to __target.manip with device angle format.
Definition at line 695 of file robot.cpp.
References fawkes::OpenRaveManipulator::angles_or_to_device().
|
virtual |
Load robot from xml file.
filename | path to robot's xml file |
env | pointer to OpenRaveEnvironment object |
Definition at line 178 of file robot.cpp.
References fawkes::Logger::log_debug().
Referenced by OpenRaveRobot().
|
virtual |
Release all grabbed kinbodys from the robot.
Definition at line 814 of file robot.cpp.
References fawkes::target_t::ikparam, fawkes::Logger::log_debug(), fawkes::Logger::log_error(), fawkes::Logger::log_warn(), fawkes::target_t::manip, fawkes::target_t::qw, fawkes::target_t::qx, fawkes::target_t::qy, fawkes::target_t::qz, fawkes::OpenRaveManipulator::set_angles(), set_target_euler(), set_target_ikparam(), fawkes::target_t::solvable, fawkes::TARGET_NONE, fawkes::TARGET_TRANSFORM, fawkes::target_t::type, fawkes::target_t::x, fawkes::target_t::y, and fawkes::target_t::z.
|
virtual |
Release a kinbody from the robot.
object | KinbodyPtr of object to be released |
Definition at line 780 of file robot.cpp.
References fawkes::Logger::log_warn().
Referenced by release_object().
|
virtual |
Release a kinbody from the robot.
name | name of the object |
env | pointer to OpenRaveEnvironment object |
Definition at line 799 of file robot.cpp.
References release_object().
|
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 284 of file robot.cpp.
References fawkes::OpenRaveManipulator::copy(), and fawkes::target_t::manip.
|
virtual |
|
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 200 of file robot.cpp.
References fawkes::Logger::log_debug().
Referenced by OpenRaveRobot().
|
virtual |
Set target angles directly.
angles | vector with angle values |
Definition at line 623 of file robot.cpp.
References fawkes::target_t::manip, fawkes::OpenRaveManipulator::set_angles(), fawkes::target_t::solvable, fawkes::TARGET_JOINTS, and fawkes::target_t::type.
|
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 |
filter | IK filter options (see OpenRAVE doc for details) |
no_offset | if true, do not include manipulator offset (default: 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 |
filter | IK filter options (see OpenRAVE doc for details) |
no_offset | if true, do not include manipulator offset (default: false) |
Definition at line 444 of file robot.cpp.
References fawkes::EULER_ZXZ, fawkes::EULER_ZYX, fawkes::EULER_ZYZ, fawkes::Logger::log_debug(), fawkes::target_t::solvable, fawkes::TARGET_NONE, and fawkes::target_t::type.
Referenced by release_all_objects().
|
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 |
filter | IK filter options (see OpenRAVE doc for details) |
Definition at line 561 of file robot.cpp.
References fawkes::target_t::ikparam, fawkes::target_t::solvable, fawkes::TARGET_IKPARAM, and fawkes::target_t::type.
Referenced by release_all_objects().
|
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) |
filter | IK filter options (see OpenRAVE doc for details) |
|
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 581 of file robot.cpp.
References fawkes::target_t::plannerparams.
|
virtual |
Set additional planner parameters.
params | complete string of additional arguments. |
Definition at line 590 of file robot.cpp.
References fawkes::target_t::plannerparams.
|
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 |
filter | IK filter options (see OpenRAVE doc for details) |
no_offset | if true, do not include manipulator offset (default: false) |
|
virtual |
Set raw command for BaseManipulation module.
BaseManipulation module accepts many arguments that can be passed. Basic commands are covered by the other set_target_ methods. In case something is not covered, or you want to send a custom command, use this method. Remember that plannerparams set by "set_target_plannerparams" are still added to the planner, so make sure you don't send duplicate entries both in plannerparams and in the raw command string.
cmd | complete command string. |
Definition at line 605 of file robot.cpp.
References fawkes::target_t::raw_cmd.
|
virtual |
Set raw command for BaseManipulation module.
cmd | complete command string. |
Definition at line 614 of file robot.cpp.
References fawkes::target_t::raw_cmd.
|
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 343 of file robot.cpp.
References fawkes::target_t::solvable, fawkes::TARGET_RELATIVE, fawkes::TARGET_RELATIVE_EXT, fawkes::target_t::type, fawkes::target_t::x, fawkes::target_t::y, and fawkes::target_t::z.
Referenced by set_target_straight().
|
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 370 of file robot.cpp.
References set_target_rel().
|
virtual |
Update motor values from OpenRAVE model.
Can be used to sync real device with OpenRAVE model
Definition at line 295 of file robot.cpp.
References fawkes::OpenRaveManipulator::set_angles().
|
virtual |
Update/Set OpenRAVE motor angles.
Definition at line 305 of file robot.cpp.
References fawkes::OpenRaveManipulator::get_angles().