mirror of
https://github.com/moveit/moveit_task_constructor.git
synced 2025-11-04 14:49:57 +08:00
make cost operators const
This commit is contained in:
parent
1f8feaaf0a
commit
bbf7d415f6
@ -66,7 +66,7 @@ struct LinkMotion
|
||||
{
|
||||
LinkMotion(std::string link_name) : link_name(link_name) {}
|
||||
|
||||
double operator()(const SubTrajectory&, std::string&);
|
||||
double operator()(const SubTrajectory&, std::string&) const;
|
||||
|
||||
std::string link_name;
|
||||
};
|
||||
@ -85,7 +85,7 @@ struct Clearance
|
||||
Interface::Direction interface = Interface::NONE)
|
||||
: with_world(with_world), cumulative(cumulative), group_property(group_property), interface(interface) {}
|
||||
|
||||
double operator()(const SubTrajectory& s, std::string& comment);
|
||||
double operator()(const SubTrajectory& s, std::string& comment) const;
|
||||
|
||||
bool with_world;
|
||||
bool cumulative;
|
||||
|
||||
@ -64,7 +64,7 @@ double TrajectoryDuration(const SubTrajectory& s) {
|
||||
return s.trajectory() ? s.trajectory()->getDuration() : 0.0;
|
||||
}
|
||||
|
||||
double LinkMotion::operator()(const SubTrajectory& s, std::string& comment) {
|
||||
double LinkMotion::operator()(const SubTrajectory& s, std::string& comment) const {
|
||||
const auto& traj{ s.trajectory() };
|
||||
|
||||
if (traj == nullptr || traj->getWayPointCount() == 0)
|
||||
@ -87,7 +87,7 @@ double LinkMotion::operator()(const SubTrajectory& s, std::string& comment) {
|
||||
return distance;
|
||||
}
|
||||
|
||||
double Clearance::operator()(const SubTrajectory& s, std::string& comment) {
|
||||
double Clearance::operator()(const SubTrajectory& s, std::string& comment) const {
|
||||
const std::string PREFIX{ "Clearance: " };
|
||||
|
||||
collision_detection::DistanceRequest request;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user