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 for issue 43 #153

Merged
merged 9 commits into from
Jun 12, 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
4 changes: 2 additions & 2 deletions include/ignition/gazebo/components/Actor.hh
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
#ifndef IGNITION_GAZEBO_COMPONENTS_ACTOR_HH_
#define IGNITION_GAZEBO_COMPONENTS_ACTOR_HH_

#include <ignition/msgs/actor.pb.h>

#include <chrono>
#include <string>

#include <ignition/msgs/actor.pb.h>

#include <sdf/Actor.hh>

#include <ignition/gazebo/components/Factory.hh>
Expand Down
6 changes: 3 additions & 3 deletions src/SimulationRunner.hh
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,16 @@ namespace ignition
struct WorldControl
{
/// \brief True to pause simulation.
// cppcheck-suppress unusedStructMember
/// cppcheck-suppress unusedStructMember
bool pause{false}; // NOLINT

/// \biref Run a given number of simulation iterations.
// cppcheck-suppress unusedStructMember
/// cppcheck-suppress unusedStructMember
uint64_t multiStep{0u}; // NOLINT

/// \brief Reset simulation back to time zero. Rewinding resets sim time,
/// real time and iterations.
// cppcheck-suppress unusedStructMember
/// cppcheck-suppress unusedStructMember
bool rewind{false}; // NOLINT

/// \brief Sim time to jump to. A negative value means don't seek.
Expand Down
67 changes: 65 additions & 2 deletions src/gui/plugins/video_recorder/VideoRecorder.qml
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,75 @@ ToolBar {
title: "Save the recorded video"
folder: shortcuts.home
selectExisting: false
property var fileFormat: ""
property var selectedFormat: ""

function getFormat(url) {
return (url.slice(url.lastIndexOf(".") + 1))
}

onAccepted: {
VideoRecorder.OnSave(fileDialog.fileUrl)
close()
fileFormat = getFormat(fileUrl.toString())
if (fileFormat == fileUrl.toString()) {
// no format specified
VideoRecorder.OnSave(fileFormat + "." + selectedFormat)
close()
}
else if (fileFormat != selectedFormat){
// wrong format specified
mismatchDialog.open()
} else {
// correct format specified
VideoRecorder.OnSave(fileUrl)
close()
}
}
onRejected: {
VideoRecorder.OnCancel()
close()
}
}

Dialog {
id: mismatchDialog
title: "Enconding and filename mismatch"
modal: true
focus: false
width: 700
height: 200
parent: ApplicationWindow.overlay
x: (parent.width - width) / 2
y: (parent.height - height) / 2
mcres marked this conversation as resolved.
Show resolved Hide resolved
standardButtons: Dialog.Save | Dialog.Abort

GridLayout {
id: grid
rows: 2
flow: GridLayout.TopToBottom
anchors.fill: parent

Label {
text: "File extension doesn't correspond with video encoding."
font.pixelSize: 20
}

Label {
text: "Click 'Abort' to change the name or 'Save' to continue."
font.pixelSize: 20
}
}

onAccepted: {
VideoRecorder.OnSave(fileDialog.fileUrl)
VideoRecorder.close()
close()
}
onRejected: {
fileDialog.open()
close()
}
}

SequentialAnimation {
id: animation;
loops: Animation.Infinite
Expand All @@ -73,13 +132,17 @@ ToolBar {
MenuItem {
text: "mp4"
onTriggered: {
fileDialog.nameFilters = ["*.mp4"]
fileDialog.selectedFormat = "mp4"
VideoRecorder.OnStart("mp4")
animation.start()
}
}
MenuItem {
text: "ogv"
onTriggered: {
fileDialog.nameFilters = ["*.ogv"]
fileDialog.selectedFormat = "ogv"
VideoRecorder.OnStart("ogv")
animation.start()
}
Expand Down
6 changes: 4 additions & 2 deletions test/integration/follow_actor_system.cc
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,14 @@ TEST_P(FollowActorTest, PublishCmd)
components::Name("box"));
EXPECT_NE(kNullEntity, targetEntity);

auto animNameComp = _ecm.Component<components::AnimationName>(actorEntity);
auto animNameComp =
_ecm.Component<components::AnimationName>(actorEntity);
ASSERT_NE(nullptr, animNameComp);
EXPECT_EQ("walking", animNameComp->Data());

// Animation time is always increasing
auto animTimeComp = _ecm.Component<components::AnimationTime>(actorEntity);
auto animTimeComp =
_ecm.Component<components::AnimationTime>(actorEntity);
ASSERT_NE(nullptr, animTimeComp);

// Actor pose is fixed to zero X/Y and initial Z
Expand Down
4 changes: 2 additions & 2 deletions test/integration/physics_system.cc
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ TEST_F(PhysicsSystemFixture, ResetPositionComponent)

double pos0 = 0.42;

// cppcheck-suppress variableScope
/// cppcheck-suppress variableScope
bool firstRun = true;

testSystem.OnPreUpdate(
Expand Down Expand Up @@ -773,7 +773,7 @@ TEST_F(PhysicsSystemFixture, ResetVelocityComponent)

double vel0 = 3.0;

// cppcheck-suppress variableScope
/// cppcheck-suppress variableScope
bool firstRun = true;

testSystem.OnPreUpdate(
Expand Down