Skip to content
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

Avoid exporting SolidReference to URDF #4102

Merged
merged 7 commits into from
Jan 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/reference/changelog-r2022.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Webots R2022 Change Log


## Webots R2022a Revision 1
Released on XX XX, 2022.

- Bug fixes
- Fixed the URDF exportation of [SolidReference](solidreference.md) nodes ([#4102](https://github.com/cyberbotics/webots/pull/4102)).

## Webots R2022a
Released on December 21th, 2022.

Expand Down
2 changes: 1 addition & 1 deletion src/webots/nodes/WbBallJoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ void WbBallJoint::updateJointAxisRepresentation() {

void WbBallJoint::writeExport(WbVrmlWriter &writer) const {
if (writer.isUrdf() && solidEndPoint()) {
warn(tr("Exporting 'BallJoint' nodes to URDF is currently not supported"));
this->warn("Exporting 'BallJoint' nodes to URDF is currently not supported");
return;
}
WbBasicJoint::writeExport(writer);
Expand Down
6 changes: 6 additions & 0 deletions src/webots/nodes/WbJoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "WbNodeUtilities.hpp"
#include "WbPositionSensor.hpp"
#include "WbRobot.hpp"
#include "WbSolidReference.hpp"
#include "WbWrenRenderingContext.hpp"

#include <wren/config.h>
Expand Down Expand Up @@ -321,6 +322,11 @@ const QString WbJoint::urdfName() const {

void WbJoint::writeExport(WbVrmlWriter &writer) const {
if (writer.isUrdf() && solidEndPoint()) {
if (dynamic_cast<WbSolidReference *>(mEndPoint->value())) {
this->warn("Exporting a Joint node with a SolidRefernce endpoint to URDF is not supported.");
return;
}

const WbNode *const parentRoot = findUrdfLinkRoot();
const WbVector3 currentOffset = solidEndPoint()->translation() - anchor();
const WbVector3 translation = solidEndPoint()->translationFrom(parentRoot) - currentOffset + writer.jointOffset();
Expand Down