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

Added camera tracking #226

Merged
merged 32 commits into from
Jul 6, 2021
Merged
Show file tree
Hide file tree
Changes from 6 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 May 8, 2021
a603923
tweaks
chapulina May 8, 2021
0223961
Add scene provider example
chapulina May 12, 2021
b53bb5e
Example to populate the scene using transport
chapulina May 12, 2021
dc3c7eb
sceneFromFirstRenderEngine
chapulina May 15, 2021
ca619ad
Added camera_controller_manager
ahcorde May 26, 2021
a1627f8
Fixed texture Id (#229)
ahcorde Jun 8, 2021
42e071f
Add sky tag to the new Scene3D (#230)
ahcorde Jun 10, 2021
591d48c
Improve example
chapulina Jun 17, 2021
af9c530
Create a new plugin and deprecate old one
chapulina Jun 17, 2021
c50f517
Add tests
chapulina Jun 19, 2021
0c4e312
Add tutorial
chapulina Jun 19, 2021
f19621c
Merge branch 'main' into chapulina/6/new_scene
chapulina Jun 19, 2021
6d3690d
codecheck
chapulina Jun 19, 2021
f9e9a52
Merge branch 'main' into chapulina/6/new_scene
chapulina Jun 24, 2021
7e3be22
Merge branch 'main' into chapulina/6/new_scene
chapulina Jun 24, 2021
1896080
Update plugins with forward merge, improve pose example
chapulina Jun 24, 2021
8a3f62f
PR feedback
chapulina Jun 24, 2021
42f29c0
PR feedback
chapulina Jun 25, 2021
dea2fd4
Merge branch 'main' into chapulina/6/new_scene
chapulina Jun 25, 2021
081410e
Merge branch 'main' into chapulina/6/new_scene
ahcorde Jun 28, 2021
83d7c33
Merge remote-tracking branch 'origin/chapulina/6/new_scene' into ahco…
ahcorde Jun 28, 2021
d68ffc8
Added feddback
ahcorde Jun 28, 2021
65fb234
make linters happy
ahcorde Jun 28, 2021
c0ebe09
Merge branch 'main' into chapulina/6/new_scene
chapulina Jun 30, 2021
cdb85dc
ign-utils impl
chapulina Jun 30, 2021
25d0d1c
Merge branch 'chapulina/6/new_scene' into ahcorde/camera_controller_m…
chapulina Jul 1, 2021
5fc8a01
Add to scene.config and to examples
chapulina Jul 1, 2021
1a75774
Added feedback and other tweaks
ahcorde Jul 1, 2021
ce06dda
Merge remote-tracking branch 'origin/main' into ahcorde/camera_contro…
ahcorde Jul 1, 2021
cb656ee
Restored Scene3d example config file
ahcorde Jul 1, 2021
3a5ae75
Add test, some cleanup
chapulina Jul 2, 2021
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
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ set(IGN_MATH_VER ${ignition-math6_VERSION_MAJOR})

#--------------------------------------
# Find ignition-common
ign_find_package(ignition-common4 REQUIRED)
ign_find_package(ignition-common4 REQUIRED COMPONENTS profiler)
set(IGN_COMMON_VER ${ignition-common4_VERSION_MAJOR})

#--------------------------------------
Expand Down
23 changes: 18 additions & 5 deletions examples/config/scene3d.config
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,28 @@
<title>View 1</title>
<property type="string" key="state">docked</property>
</ignition-gui>
<engine>ogre</engine>
<engine>ogre2</engine>
<scene>scene</scene>
<ambient_light>0 0 1</ambient_light>
<ambient_light>1 1 1</ambient_light>
<background_color>0.8 0.8 0.8</background_color>
<camera_pose>-6 0 6 0 0.5 0</camera_pose>
</plugin>
<plugin filename="Grid3D" name="3D Grid">
<engine>ogre</engine>
<scene>scene</scene>
<plugin filename="TransportSceneManager" name="Transport Scene Manager">
<ignition-gui>
<anchors target="View 1">
<line own="right" target="right"/>
<line own="top" target="top"/>
</anchors>
<property key="resizable" type="bool">false</property>
<property key="width" type="double">5</property>
<property key="height" type="double">5</property>
<property key="state" type="string">floating</property>
<property key="showTitleBar" type="bool">false</property>
</ignition-gui>
<service>/example/scene</service>
<pose_topic>/example/pose</pose_topic>
<deletion_topic>/example/delete</deletion_topic>
<scene_topic>/example/scene</scene_topic>
</plugin>
<!-- TODO(anyone) Support multiple scenes in the same window
plugin filename="Scene3D">
Expand Down
13 changes: 13 additions & 0 deletions examples/standalone/scene_provider/CMakeLists.txt
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
)

34 changes: 34 additions & 0 deletions examples/standalone/scene_provider/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
## 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:

```

```

76 changes: 76 additions & 0 deletions examples/standalone/scene_provider/scene_provider.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/*
* 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 <iostream>
#include <string>
#include <ignition/msgs/scene.pb.h>
#include <ignition/transport/Node.hh>

//////////////////////////////////////////////////
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);

// TODO: Add pose update publisher that moves the box periodically

ignition::transport::waitForShutdown();
}
2 changes: 2 additions & 0 deletions src/plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ function(ign_gui_add_plugin plugin_name)
endfunction()

# Plugins
add_subdirectory(camera_controller_manager)
add_subdirectory(grid_3d)
add_subdirectory(image_display)
add_subdirectory(key_publisher)
Expand All @@ -123,5 +124,6 @@ add_subdirectory(scene3d)
add_subdirectory(screenshot)
add_subdirectory(topic_echo)
add_subdirectory(topic_viewer)
add_subdirectory(transport_scene_manager)
add_subdirectory(world_control)
add_subdirectory(world_stats)
11 changes: 11 additions & 0 deletions src/plugins/camera_controller_manager/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
ign_gui_add_plugin(CameraControllerManager
SOURCES
CameraControllerManager.cc
QT_HEADERS
CameraControllerManager.hh
TEST_SOURCES
# CameraControllerManager_TEST.cc
PUBLIC_LINK_LIBS
ignition-rendering${IGN_RENDERING_VER}::ignition-rendering${IGN_RENDERING_VER}
ignition-common${IGN_COMMON_VER}::profiler
)
Loading