-
Notifications
You must be signed in to change notification settings - Fork 238
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #215 from ROBOTIS-GIT/hotfix
om friends missing libraries added
- Loading branch information
Showing
45 changed files
with
11,018 additions
and
0 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
arduino/opencr_arduino/opencr/libraries/OpenManipulator/src/delta_libs.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#include "delta_libs/include/delta_libs/delta.h" |
74 changes: 74 additions & 0 deletions
74
...opencr_arduino/opencr/libraries/OpenManipulator/src/delta_libs/include/delta_libs/delta.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/******************************************************************************* | ||
* Copyright 2018 ROBOTIS CO., LTD. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*******************************************************************************/ | ||
|
||
/* Authors: Darby Lim, Hye-Jong KIM, Ryan Shim, Yong-Ho Na */ | ||
|
||
#ifndef DELTA_H_ | ||
#define DELTA_H_ | ||
|
||
#include "delta_custom_trajectory.h" | ||
#include "delta_dynamixel.h" | ||
#include "delta_kinematics.h" | ||
|
||
#define CUSTOM_TRAJECTORY_SIZE 4 | ||
#define CUSTOM_TRAJECTORY_LINE "custom_trajectory_line" | ||
#define CUSTOM_TRAJECTORY_CIRCLE "custom_trajectory_circle" | ||
#define CUSTOM_TRAJECTORY_RHOMBUS "custom_trajectory_rhombus" | ||
#define CUSTOM_TRAJECTORY_HEART "custom_trajectory_heart" | ||
|
||
#define DXL_SIZE 3 | ||
#define JOINT_DYNAMIXEL "joint_dxl" | ||
|
||
#define RECEIVE_RATE 0.100 // unit: s | ||
#define CONTROL_RATE 0.010 // unit: s | ||
|
||
#define X_AXIS robotis_manipulator::math::vector3(1.0, 0.0, 0.0) | ||
#define Y_AXIS robotis_manipulator::math::vector3(0.0, 1.0, 0.0) | ||
#define Z_AXIS robotis_manipulator::math::vector3(0.0, 0.0, 1.0) | ||
|
||
class Delta : public robotis_manipulator::RobotisManipulator | ||
{ | ||
private: | ||
robotis_manipulator::Kinematics *kinematics_; | ||
robotis_manipulator::JointActuator *joint_; | ||
robotis_manipulator::ToolActuator *tool_; | ||
robotis_manipulator::CustomTaskTrajectory *custom_trajectory_[CUSTOM_TRAJECTORY_SIZE]; | ||
|
||
bool using_actual_robot_state_; | ||
bool receive_data_flag_ = false; | ||
double prev_receive_time_ = 0.0; | ||
double prev_control_time_ = 0.0; | ||
|
||
public: | ||
Delta(); | ||
virtual ~Delta(); | ||
|
||
void initDebug(); | ||
void initOpenManipulator(bool using_actual_robot_state, | ||
STRING usb_port = "/dev/ttyUSB0", | ||
STRING baud_rate = "1000000", | ||
float control_rate = CONTROL_RATE); | ||
void processOpenManipulator(double present_time); | ||
|
||
bool getUsingActualRobotState(); | ||
bool getReceiveDataFlag(); | ||
double getPrevReceiveTime(); | ||
|
||
void setReceiveDataFlag(bool receive_data_flag); | ||
void setPrevReceiveTime(double prev_receive_time); | ||
}; | ||
|
||
#endif // Delta_H_ |
158 changes: 158 additions & 0 deletions
158
...ncr/libraries/OpenManipulator/src/delta_libs/include/delta_libs/delta_custom_trajectory.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
/******************************************************************************* | ||
* Copyright 2018 ROBOTIS CO., LTD. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*******************************************************************************/ | ||
|
||
/* Authors: Darby Lim, Hye-Jong KIM, Ryan Shim, Yong-Ho Na */ | ||
|
||
#ifndef SCARA_CUSTOM_TRAJECTORY_H_ | ||
#define SCARA_CUSTOM_TRAJECTORY_H_ | ||
|
||
#if defined(__OPENCR__) | ||
#include <RobotisManipulator.h> | ||
#else | ||
#include <robotis_manipulator/robotis_manipulator.h> | ||
#endif | ||
|
||
using namespace robotis_manipulator; | ||
using namespace Eigen; | ||
|
||
namespace delta_custom_trajectory | ||
{ | ||
|
||
enum AXIS{ | ||
X_AXIS, | ||
Y_AXIS, | ||
Z_AXIS, | ||
}; | ||
|
||
/***************************************************************************** | ||
** Line | ||
*****************************************************************************/ | ||
class Line : public robotis_manipulator::CustomTaskTrajectory | ||
{ | ||
private: | ||
TaskWaypoint start_pose_; | ||
TaskWaypoint goal_pose_; | ||
|
||
double acc_dec_time_; | ||
double move_time_; | ||
std::vector<double> vel_max_; | ||
|
||
public: | ||
Line() {} | ||
virtual ~Line() {} | ||
|
||
void initLine(double move_time, TaskWaypoint start, TaskWaypoint delta); | ||
TaskWaypoint drawLine(double time_var); | ||
|
||
virtual void setOption(const void *arg); | ||
virtual void makeTaskTrajectory(double move_time, TaskWaypoint start, const void *arg); | ||
virtual TaskWaypoint getTaskWaypoint(double tick); | ||
}; | ||
|
||
|
||
/***************************************************************************** | ||
** Circle | ||
*****************************************************************************/ | ||
class Circle : public robotis_manipulator::CustomTaskTrajectory | ||
{ | ||
private: | ||
robotis_manipulator::MinimumJerk path_generator_; | ||
VectorXd coefficient_; | ||
|
||
TaskWaypoint start_pose_; | ||
TaskWaypoint goal_pose_; | ||
|
||
double radius_; | ||
double start_angular_position_; | ||
double revolution_; | ||
|
||
public: | ||
Circle() {} | ||
virtual ~Circle() {} | ||
|
||
void initCircle(double move_time, TaskWaypoint start, double radius, double revolution, double start_angular_position); | ||
TaskWaypoint drawCircle(double time_var); | ||
|
||
virtual void setOption(const void *arg); | ||
virtual void makeTaskTrajectory(double move_time, TaskWaypoint start, const void *arg); | ||
virtual TaskWaypoint getTaskWaypoint(double tick); | ||
}; | ||
|
||
|
||
/***************************************************************************** | ||
** Rhombus | ||
*****************************************************************************/ | ||
class Rhombus : public robotis_manipulator::CustomTaskTrajectory | ||
{ | ||
private: | ||
robotis_manipulator::MinimumJerk path_generator_; | ||
VectorXd coefficient_; | ||
|
||
TaskWaypoint start_pose_; | ||
TaskWaypoint goal_pose_; | ||
|
||
double radius_; | ||
double start_angular_position_; | ||
double revolution_; | ||
|
||
public: | ||
Rhombus() {} | ||
virtual ~Rhombus() {} | ||
|
||
void initRhombus(double move_time, TaskWaypoint start, double radius, double revolution, double start_angular_position); | ||
TaskWaypoint drawRhombus(double time_var); | ||
|
||
virtual void setOption(const void *arg); | ||
virtual void makeTaskTrajectory(double move_time, TaskWaypoint start, const void *arg); | ||
virtual TaskWaypoint getTaskWaypoint(double tick); | ||
}; | ||
|
||
|
||
/***************************************************************************** | ||
** Heart | ||
*****************************************************************************/ | ||
class Heart : public robotis_manipulator::CustomTaskTrajectory | ||
{ | ||
private: | ||
robotis_manipulator::MinimumJerk path_generator_; | ||
VectorXd coefficient_; | ||
|
||
TaskWaypoint start_pose_; | ||
TaskWaypoint goal_pose_; | ||
|
||
double radius_; | ||
double start_angular_position_; | ||
double revolution_; | ||
|
||
public: | ||
Heart() {} | ||
virtual ~Heart() {} | ||
|
||
void initHeart(double move_time, TaskWaypoint start, double radius, double revolution, double start_angular_position); | ||
TaskWaypoint drawHeart(double tick); | ||
|
||
virtual void setOption(const void *arg); | ||
virtual void makeTaskTrajectory(double move_time, TaskWaypoint start, const void *arg); | ||
virtual TaskWaypoint getTaskWaypoint(double tick); | ||
}; | ||
|
||
|
||
} // namespace delta_custom_trajectory | ||
#endif // DELTA_CUSTOM_TRAJECTORY_H_ | ||
|
||
|
||
|
||
|
Oops, something went wrong.