Skip to content

Commit

Permalink
make acceleration configurable (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
raybjork authored Feb 5, 2025
1 parent c11a9cc commit 4efe7e1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ur5e_arm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ void UR5eArm::reconfigure(const Dependencies& deps, const ResourceConfig& cfg) {
// extract relevant attributes from config
host = find_config_attribute<std::string>(cfg, "host");
speed = find_config_attribute<double>(cfg, "speed_degs_per_sec") * (M_PI / 180.0);
acceleration = find_config_attribute<double>(cfg, "acceleration_degs_per_sec2") * (M_PI / 180.0);
}

std::vector<double> UR5eArm::get_joint_positions(const ProtoStruct& extra) {
Expand Down Expand Up @@ -236,7 +237,7 @@ void UR5eArm::move(std::vector<Eigen::VectorXd> waypoints) {
BOOST_LOG_TRIVIAL(debug) << "generating trajectory with max speed: " << speed * (180.0 / M_PI) << std::endl;
Eigen::VectorXd max_acceleration(6);
Eigen::VectorXd max_velocity(6);
max_acceleration << 8.0, 8.0, 8.0, 8.0, 8.0, 8.0;
max_acceleration << acceleration, acceleration, acceleration, acceleration, acceleration, acceleration;
max_velocity << speed, speed, speed, speed, speed, speed;

std::vector<vector6d_t> p;
Expand Down
1 change: 1 addition & 0 deletions src/ur5e_arm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,5 @@ class UR5eArm : public Arm, public Reconfigurable {
// variables specified by ResourceConfig and set through reconfigure
std::string host;
double speed;
double acceleration;
};

0 comments on commit 4efe7e1

Please sign in to comment.