Skip to content

Commit

Permalink
use boost's trivial logger
Browse files Browse the repository at this point in the history
  • Loading branch information
raybjork committed Oct 8, 2024
1 parent a460d71 commit b584477
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ur5e_arm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ std::atomic<bool> trajectory_running(false);
// define callback function to be called by UR client library when program state changes
void reportRobotProgramState(bool program_running) {
// Print the text in green so we see it better
std::cout << "\033[1;32mprogram running: " << std::boolalpha << program_running << "\033[0m\n" << std::endl;
BOOST_LOG_TRIVIAL(info) << "\033[1;32mUR program running: " << std::boolalpha << program_running << "\033[0m\n" << std::endl;
}

// define callback function to be called by UR client library when trajectory state changes
Expand All @@ -24,7 +24,7 @@ void reportTrajectoryState(control::TrajectoryResult state) {
default:
report = "failure";
}
std::cout << "\033[1;32mtrajectory report: " << report << "\033[0m\n" << std::endl;
BOOST_LOG_TRIVIAL(debug) << "\033[1;32mtrajectory report: " << report << "\033[0m\n" << std::endl;
}

UR5eArm::UR5eArm(Dependencies deps, const ResourceConfig& cfg) : Arm(cfg.name()) {
Expand Down Expand Up @@ -234,7 +234,7 @@ void UR5eArm::move(std::vector<Eigen::VectorXd> waypoints) {
segments.push_back(waypoints.size() - 1);

// set velocity/acceleration constraints
std::cout << "generating trajectory with max speed: " << speed * (180.0 / M_PI) << std::endl;
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;
Expand Down
1 change: 1 addition & 0 deletions src/ur5e_arm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <ur_client_library/ur/dashboard_client.h>
#include <ur_client_library/ur/ur_driver.h>

#include <boost/log/trivial.hpp>
#include <viam/sdk/components/arm.hpp>
#include <viam/sdk/components/component.hpp>
#include <viam/sdk/config/resource.hpp>
Expand Down

0 comments on commit b584477

Please sign in to comment.