-
Notifications
You must be signed in to change notification settings - Fork 44
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
Added camera tracking #226
Merged
Merged
Changes from 24 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
3a05520
Split transport scene manager into a plugin outside Scene3D
chapulina a603923
tweaks
chapulina 0223961
Add scene provider example
chapulina b53bb5e
Example to populate the scene using transport
chapulina dc3c7eb
sceneFromFirstRenderEngine
chapulina ca619ad
Added camera_controller_manager
ahcorde a1627f8
Fixed texture Id (#229)
ahcorde 42e071f
Add sky tag to the new Scene3D (#230)
ahcorde 591d48c
Improve example
chapulina af9c530
Create a new plugin and deprecate old one
chapulina c50f517
Add tests
chapulina 0c4e312
Add tutorial
chapulina f19621c
Merge branch 'main' into chapulina/6/new_scene
chapulina 6d3690d
codecheck
chapulina f9e9a52
Merge branch 'main' into chapulina/6/new_scene
chapulina 7e3be22
Merge branch 'main' into chapulina/6/new_scene
chapulina 1896080
Update plugins with forward merge, improve pose example
chapulina 8a3f62f
PR feedback
chapulina 42f29c0
PR feedback
chapulina dea2fd4
Merge branch 'main' into chapulina/6/new_scene
chapulina 081410e
Merge branch 'main' into chapulina/6/new_scene
ahcorde 83d7c33
Merge remote-tracking branch 'origin/chapulina/6/new_scene' into ahco…
ahcorde d68ffc8
Added feddback
ahcorde 65fb234
make linters happy
ahcorde c0ebe09
Merge branch 'main' into chapulina/6/new_scene
chapulina cdb85dc
ign-utils impl
chapulina 25d0d1c
Merge branch 'chapulina/6/new_scene' into ahcorde/camera_controller_m…
chapulina 5fc8a01
Add to scene.config and to examples
chapulina 1a75774
Added feedback and other tweaks
ahcorde ce06dda
Merge remote-tracking branch 'origin/main' into ahcorde/camera_contro…
ahcorde cb656ee
Restored Scene3d example config file
ahcorde 3a5ae75
Add test, some cleanup
chapulina File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR) | ||
|
||
find_package(ignition-msgs8 REQUIRED) | ||
find_package(ignition-transport11 REQUIRED) | ||
|
||
add_executable(scene_provider | ||
scene_provider.cc | ||
) | ||
target_link_libraries(scene_provider | ||
ignition-msgs8::core | ||
ignition-transport11::core | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
## Scene provider | ||
|
||
This example demonstrates how to populate and update a 3D scene using | ||
Ignition Transport. | ||
|
||
This example is meant to be used with `examples/config/scened.config`, which | ||
loads the `Scene3D` plugin to create the scene, and the `TransportSceneManager` | ||
plugin to update the scene using Ignition Transport. | ||
|
||
## Build | ||
|
||
``` | ||
cd examples/standalone/scene_provider | ||
mkdir build | ||
cd build | ||
cmake .. | ||
make | ||
``` | ||
|
||
## Run | ||
|
||
In one terminal, start the scene provider: | ||
|
||
``` | ||
cd examples/standalone/scene_provider/build | ||
./scene_provider | ||
``` | ||
|
||
On another terminal, start the example config: | ||
|
||
``` | ||
ign gui -c examples/config/scene3d.config | ||
``` | ||
|
||
You should see a black box moving around the scene. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
/* | ||
* Copyright (C) 2021 Open Source Robotics Foundation | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
|
||
#include <chrono> | ||
#include <iostream> | ||
#include <string> | ||
#include <ignition/math/Rand.hh> | ||
#include <ignition/msgs/pose_v.pb.h> | ||
#include <ignition/msgs/scene.pb.h> | ||
#include <ignition/transport/Node.hh> | ||
|
||
using namespace std::chrono_literals; | ||
|
||
////////////////////////////////////////////////// | ||
bool sceneService(ignition::msgs::Scene &_rep) | ||
{ | ||
std::cout << "Returning scene" << std::endl; | ||
|
||
// Light | ||
auto lightMsg = _rep.add_light(); | ||
|
||
auto diffuseMsg = lightMsg->mutable_diffuse(); | ||
diffuseMsg->set_r(1.0); | ||
diffuseMsg->set_g(1.0); | ||
diffuseMsg->set_b(1.0); | ||
|
||
auto directionMsg = lightMsg->mutable_direction(); | ||
directionMsg->set_x(0.0); | ||
directionMsg->set_y(0.0); | ||
directionMsg->set_z(1.0); | ||
|
||
// Box | ||
auto modelMsg = _rep.add_model(); | ||
modelMsg->set_id(1); | ||
modelMsg->set_is_static(true); | ||
modelMsg->set_name("box_model"); | ||
|
||
auto linkMsg = modelMsg->add_link(); | ||
linkMsg->set_id(2); | ||
linkMsg->set_name("box_link"); | ||
|
||
auto visMsg = linkMsg->add_visual(); | ||
visMsg->set_id(3); | ||
visMsg->set_name("box_vis"); | ||
|
||
auto geomMsg = visMsg->mutable_geometry(); | ||
auto boxMsg = geomMsg->mutable_box(); | ||
auto boxSize = boxMsg->mutable_size(); | ||
boxSize->set_x(1.0); | ||
boxSize->set_y(2.0); | ||
boxSize->set_z(3.0); | ||
|
||
return true; | ||
} | ||
|
||
////////////////////////////////////////////////// | ||
int main(int argc, char **argv) | ||
{ | ||
ignition::transport::Node node; | ||
|
||
// Scene service | ||
node.Advertise("/example/scene", sceneService); | ||
|
||
// Periodic pose updated | ||
auto posePub = node.Advertise<ignition::msgs::Pose_V>("/example/pose"); | ||
|
||
ignition::msgs::Pose_V poseVMsg; | ||
auto poseMsg = poseVMsg.add_pose(); | ||
poseMsg->set_id(1); | ||
poseMsg->set_name("box_model"); | ||
auto positionMsg = poseMsg->mutable_position(); | ||
|
||
const double change{0.1}; | ||
|
||
double x{0.0}; | ||
double y{0.0}; | ||
double z{0.0}; | ||
|
||
while (true) | ||
{ | ||
std::this_thread::sleep_for(100ms); | ||
|
||
x += ignition::math::Rand::DblUniform(-change, change); | ||
y += ignition::math::Rand::DblUniform(-change, change); | ||
z += ignition::math::Rand::DblUniform(-change, change); | ||
|
||
positionMsg->set_x(x); | ||
positionMsg->set_y(y); | ||
positionMsg->set_z(z); | ||
posePub.Publish(poseVMsg); | ||
} | ||
|
||
ignition::transport::waitForShutdown(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
ign_gui_add_plugin(CameraTracking | ||
SOURCES | ||
CameraTracking.cc | ||
QT_HEADERS | ||
CameraTracking.hh | ||
TEST_SOURCES | ||
# CameraTracking_TEST.cc | ||
PUBLIC_LINK_LIBS | ||
ignition-rendering${IGN_RENDERING_VER}::ignition-rendering${IGN_RENDERING_VER} | ||
ignition-common${IGN_COMMON_VER}::profiler | ||
) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
a nightly build failure is a good reminder to update the Debian metadata with this new dependency
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.
We should add these to the buildfarmer's dashboard 😏
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 will be learning about that soon
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.
we can start by adding them to our Jenkins views: gazebo-tooling/release-tools#491