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

Fix Actor.cc copy operators and restructure tests #301

Merged
merged 8 commits into from
Jul 1, 2020
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
3 changes: 3 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

### SDFormat 8.X.X (202X-XX-XX)

1. Fix Actor copy operators and increase test coverage.
* [Pull request 301](https://github.com/osrf/sdformat/pull/301)

1. Increase output precision of URDF to SDF conversion, output -0 as 0.
* [BitBucket pull request 675](https://osrf-migration.github.io/sdformat-gh-pages/#!/osrf/sdformat/pull-requests/675)

Expand Down
16 changes: 8 additions & 8 deletions src/Actor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,8 @@ Animation::~Animation()

//////////////////////////////////////////////////
Animation::Animation(const Animation &_animation)
: dataPtr(new AnimationPrivate)
: dataPtr(new AnimationPrivate(*_animation.dataPtr))
{
this->CopyFrom(_animation);
}

/////////////////////////////////////////////////
Expand All @@ -156,6 +155,7 @@ Animation &Animation::operator=(Animation &&_animation)
/////////////////////////////////////////////////
void Animation::CopyFrom(const Animation &_animation)
{
// TODO(anyone) Deprecate function
this->dataPtr->name = _animation.dataPtr->name;
this->dataPtr->filename = _animation.dataPtr->filename;
this->dataPtr->scale = _animation.dataPtr->scale;
Expand Down Expand Up @@ -269,9 +269,8 @@ Waypoint::~Waypoint()

//////////////////////////////////////////////////
Waypoint::Waypoint(const Waypoint &_waypoint)
: dataPtr(new WaypointPrivate)
: dataPtr(new WaypointPrivate(*_waypoint.dataPtr))
{
this->CopyFrom(_waypoint);
}

/////////////////////////////////////////////////
Expand All @@ -296,6 +295,7 @@ Waypoint &Waypoint::operator=(Waypoint &&_waypoint)
/////////////////////////////////////////////////
void Waypoint::CopyFrom(const Waypoint &_waypoint)
{
// TODO(anyone) deprecate function
this->dataPtr->time = _waypoint.dataPtr->time;
this->dataPtr->pose = _waypoint.dataPtr->pose;
}
Expand Down Expand Up @@ -364,9 +364,8 @@ Trajectory::~Trajectory()

//////////////////////////////////////////////////
Trajectory::Trajectory(const Trajectory &_trajectory)
: dataPtr(new TrajectoryPrivate)
: dataPtr(new TrajectoryPrivate(*_trajectory.dataPtr))
{
this->CopyFrom(_trajectory);
}

/////////////////////////////////////////////////
Expand All @@ -391,6 +390,7 @@ Trajectory &Trajectory::operator=(Trajectory &&_trajectory)
/////////////////////////////////////////////////
void Trajectory::CopyFrom(const Trajectory &_trajectory)
{
// TODO(anyone) deprecate function
this->dataPtr->id = _trajectory.dataPtr->id;
this->dataPtr->type = _trajectory.dataPtr->type;
this->dataPtr->tension = _trajectory.dataPtr->tension;
Expand Down Expand Up @@ -501,9 +501,8 @@ Actor::~Actor()

//////////////////////////////////////////////////
Actor::Actor(const Actor &_actor)
: dataPtr(new ActorPrivate)
: dataPtr(new ActorPrivate(*_actor.dataPtr))
{
this->CopyFrom(_actor);
}

/////////////////////////////////////////////////
Expand All @@ -528,6 +527,7 @@ Actor &Actor::operator=(Actor &&_actor)
//////////////////////////////////////////////////
void Actor::CopyFrom(const Actor &_actor)
{
// TODO(anyone) deprecate function
this->dataPtr->name = _actor.dataPtr->name;
this->dataPtr->pose = _actor.dataPtr->pose;
this->dataPtr->poseFrame = _actor.dataPtr->poseFrame;
Expand Down
Loading