@@ -364,7 +364,7 @@ bool UrDriver::startForceMode(const vector6d_t& task_frame, const vector6uint32_
364
364
std::stringstream ss;
365
365
ss << " Force mode gain scaling factor cannot be set on a CB3 robot." ;
366
366
URCL_LOG_ERROR (ss.str ().c_str ());
367
- throw std::invalid_argument (ss.str (). c_str () );
367
+ throw IncompatibleRobotVersion (ss.str (), 5 , robot_version_. major );
368
368
}
369
369
// Test that the type is either 1, 2 or 3.
370
370
switch (type)
@@ -379,7 +379,7 @@ bool UrDriver::startForceMode(const vector6d_t& task_frame, const vector6uint32_
379
379
std::stringstream ss;
380
380
ss << " The type should be 1, 2 or 3. The type is " << type;
381
381
URCL_LOG_ERROR (ss.str ().c_str ());
382
- throw std::invalid_argument (ss.str ().c_str ());
382
+ throw InvalidRange (ss.str ().c_str ());
383
383
}
384
384
for (unsigned int i = 0 ; i < selection_vector.size (); ++i)
385
385
{
@@ -388,7 +388,7 @@ bool UrDriver::startForceMode(const vector6d_t& task_frame, const vector6uint32_
388
388
std::stringstream ss;
389
389
ss << " The selection vector should only consist of 0's and 1's" ;
390
390
URCL_LOG_ERROR (ss.str ().c_str ());
391
- throw std::invalid_argument (ss.str ().c_str ());
391
+ throw InvalidRange (ss.str ().c_str ());
392
392
}
393
393
}
394
394
@@ -397,15 +397,15 @@ bool UrDriver::startForceMode(const vector6d_t& task_frame, const vector6uint32_
397
397
std::stringstream ss;
398
398
ss << " The force mode damping factor should be between 0 and 1, both inclusive." ;
399
399
URCL_LOG_ERROR (ss.str ().c_str ());
400
- throw std::invalid_argument (ss.str ().c_str ());
400
+ throw InvalidRange (ss.str ().c_str ());
401
401
}
402
402
403
403
if (gain_scaling_factor > 2 || gain_scaling_factor < 0 )
404
404
{
405
405
std::stringstream ss;
406
406
ss << " The force mode gain scaling factor should be between 0 and 2, both inclusive." ;
407
407
URCL_LOG_ERROR (ss.str ().c_str ());
408
- throw std::invalid_argument (ss.str ().c_str ());
408
+ throw InvalidRange (ss.str ().c_str ());
409
409
}
410
410
411
411
if (script_command_interface_->clientConnected ())
@@ -430,7 +430,7 @@ bool UrDriver::startForceMode(const vector6d_t& task_frame, const vector6uint32_
430
430
std::stringstream ss;
431
431
ss << " You should also specify a force mode gain scaling factor to activate force mode on an e-series robot." ;
432
432
URCL_LOG_ERROR (ss.str ().c_str ());
433
- throw std::invalid_argument (ss.str (). c_str () );
433
+ throw IncompatibleRobotVersion (ss.str (), 3 , robot_version_. major );
434
434
}
435
435
// Test that the type is either 1, 2 or 3.
436
436
switch (type)
@@ -445,7 +445,7 @@ bool UrDriver::startForceMode(const vector6d_t& task_frame, const vector6uint32_
445
445
std::stringstream ss;
446
446
ss << " The type should be 1, 2 or 3. The type is " << type;
447
447
URCL_LOG_ERROR (ss.str ().c_str ());
448
- throw std::invalid_argument (ss.str ().c_str ());
448
+ throw InvalidRange (ss.str ().c_str ());
449
449
}
450
450
for (unsigned int i = 0 ; i < selection_vector.size (); ++i)
451
451
{
@@ -454,7 +454,7 @@ bool UrDriver::startForceMode(const vector6d_t& task_frame, const vector6uint32_
454
454
std::stringstream ss;
455
455
ss << " The selection vector should only consist of 0's and 1's" ;
456
456
URCL_LOG_ERROR (ss.str ().c_str ());
457
- throw std::invalid_argument (ss.str ().c_str ());
457
+ throw InvalidRange (ss.str ().c_str ());
458
458
}
459
459
}
460
460
@@ -463,7 +463,7 @@ bool UrDriver::startForceMode(const vector6d_t& task_frame, const vector6uint32_
463
463
std::stringstream ss;
464
464
ss << " The force mode damping factor should be between 0 and 1, both inclusive." ;
465
465
URCL_LOG_ERROR (ss.str ().c_str ());
466
- throw std::invalid_argument (ss.str ().c_str ());
466
+ throw InvalidRange (ss.str ().c_str ());
467
467
}
468
468
469
469
if (script_command_interface_->clientConnected ())
0 commit comments