37 const std::string
SCRIPT_FILE =
"resources/external_control.urscript";
38 const std::string
OUTPUT_RECIPE =
"examples/resources/rtde_output_recipe.txt";
39 const std::string
INPUT_RECIPE =
"examples/resources/rtde_input_recipe.txt";
49 std::cout <<
"\033[1;32mProgram running: " << std::boolalpha << program_running <<
"\033[0m\n" << std::endl;
54 bool ret =
g_my_driver->writeFreedriveControlMessage(freedrive_action);
57 URCL_LOG_ERROR(
"Could not send joint command. Is the robot in remote control?");
62 int main(
int argc,
char* argv[])
69 robot_ip = std::string(argv[1]);
73 auto second_to_run = std::chrono::seconds(0);
76 second_to_run = std::chrono::seconds(std::stoi(argv[2]));
117 std::unique_ptr<ToolCommSetup> tool_comm_setup;
118 const bool HEADLESS =
true;
127 std::chrono::duration<double> time_done(0);
128 std::chrono::duration<double> timeout(second_to_run);
129 auto stopwatch_last = std::chrono::steady_clock::now();
130 auto stopwatch_now = stopwatch_last;
135 { 0, 0, 1, 0, 0, 1 },
136 { 0, 0, 0, 0, 0, 0 },
138 { 0.1, 0.1, 1.5, 3.14, 3.14, 0.5 });
147 std::unique_ptr<rtde_interface::DataPackage> data_pkg =
g_my_driver->getDataPackage();
152 if (time_done > timeout && second_to_run.count() != 0)
160 URCL_LOG_WARN(
"Could not get fresh data package from robot");
163 stopwatch_now = std::chrono::steady_clock::now();
164 time_done += stopwatch_now - stopwatch_last;
165 stopwatch_last = stopwatch_now;
#define URCL_LOG_ERROR(...)
This is the main class for interfacing the driver.
std::unique_ptr< UrDriver > g_my_driver
void sendFreedriveMessageOrDie(const control::FreedriveControlMessage freedrive_action)
FreedriveControlMessage
Control messages for starting and stopping freedrive mode.
const std::string DEFAULT_ROBOT_IP
int main(int argc, char *argv[])
std::unique_ptr< DashboardClient > g_my_dashboard
void setLogLevel(LogLevel level)
Set log level this will disable messages with lower log level.
const std::string OUTPUT_RECIPE
const std::string SCRIPT_FILE
void handleRobotProgramState(bool program_running)
const std::string INPUT_RECIPE
#define URCL_LOG_WARN(...)
const std::string CALIBRATION_CHECKSUM
This class is a wrapper around the dashboard server.
#define URCL_LOG_INFO(...)