Skip to content

Commit

Permalink
make acceleration configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
raybjork committed Feb 5, 2025
1 parent 435de77 commit ef9e561
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions 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 @@ -194,7 +195,6 @@ void UR5eArm::keep_alive() {
mu.lock();
read_and_noop();
mu.unlock();
usleep(NOOP_DELAY);
}
}

Expand Down Expand Up @@ -236,7 +236,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 << 1.0, 1.0, 1.0, 1.0, 1.0, 1.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 ef9e561

Please sign in to comment.