-
Notifications
You must be signed in to change notification settings - Fork 939
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Windows][master] remove GCC extension and alternative operator usage. #1583
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not convinced that the array to std::vector
changes were absolutely necessary but otherwise it looks good.
@seanyen please run clang-format on the code as per https://moveit.ros.org//documentation/contributing/code/ |
@@ -1231,7 +1231,7 @@ bool RobotState::getJacobian(const JointModelGroup* group, const LinkModel* link | |||
const JointModel* pjm = link->getParentJointModel(); | |||
if (pjm->getVariableCount() > 0) | |||
{ | |||
if (not group->hasJointModel(pjm->getName())) | |||
if (!group->hasJointModel(pjm->getName())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what a shame MSVC is still not C++ standards compliant. wasn't there a compiler flag to enable a more compliant mode?
std::string demangled_name = abi::__cxa_demangle(adapter_name.c_str(), NULL, NULL, &status); | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessarily something that needs to be addressed in this pull-request, but I would vote for removing this ugly chunk altogether and making the initialize
method pure virtual instead.
Any comments by other maintainers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that this is ugly and should probably be at least abstracted away, we could have a general demangle.h to get these names that'd know how to support different platform on it's own but yes, the best would be to remove hacky stuff like this altogether.
What if we drop the adapter_name
variable and define a std::string getAdapterName() = 0;
? This would enforce that whoever implement an adapter defines this function to return something. May as well return a correct name. Separate PR though, let's not hold this one up for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bmagyar The logic above will always trigger when initialize
is not overridden by the child class.
It's basically a run-time, warning-only version of a pure virtual initialize
function.
There is no other place where the adapter name would be needed in the base class.
So instead of adding a new pure virtual method, as you propose, I proposed to enforce the warning condition at compile time by setting virtual void initialize(...) = 0
.
@@ -120,14 +120,14 @@ void RobotModelBuilder::addChain(const std::string& section, const std::string& | |||
return; | |||
} | |||
// First link should already be added. | |||
if (not urdf_model_->getLink(link_names[0])) | |||
if (!urdf_model_->getLink(link_names[0])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not
this is not supported in windows?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not without setting the compiler to permissive mode or including a special header.
Personally, I prefer the primary tokens to be used throughout the code base, over including windows-specific headers.
.../planning_request_adapter/include/moveit/planning_request_adapter/planning_request_adapter.h
Outdated
Show resolved
Hide resolved
@@ -443,20 +443,20 @@ void planning_scene_monitor::CurrentStateMonitor::tfCallback() | |||
continue; | |||
joint_time_[joint] = latest_common_time; | |||
|
|||
double new_values[joint->getStateSpaceDimension()]; | |||
std::vector<double> new_values(joint->getStateSpaceDimension()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah. They don't support dynamic-size arrays.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor fix required.
Co-Authored-By: Robert Haschke <rhaschke@users.noreply.github.com>
.../planning_request_adapter/include/moveit/planning_request_adapter/planning_request_adapter.h
Outdated
Show resolved
Hide resolved
Co-Authored-By: Robert Haschke <rhaschke@users.noreply.github.com>
replace the gcc extension and alternative operator usage Also guard use of Linux-specific abi header
replace the gcc extension and alternative operator usage
replace the gcc extension and alternative operator usage Also guard use of Linux-specific abi header
This change is to replace the
gcc
extension and alternative operator usage.primary tokens
.variable length array
withstd::vector
.abi::__cxa_demangle
when it is usingMSVC
toolchain.