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

Add Track and Follow options in gui EntityContextMenu #2402

Merged
merged 8 commits into from
May 22, 2024

Conversation

bperseghetti
Copy link
Member

@bperseghetti bperseghetti commented May 10, 2024

🎉 New feature

Summary

I would like to thank NXP for their support in enabling this work.

Depends on:

This adds a new /gui/track topic using the CameraTrack message to control multiple types of tracking and associated pgain(s), target(s) and offset(s). Furthermore it publishes a tracking camera status CameraTrack message on /gui/currently_tracked

This also adds an 3 unique follow modes and a tracking mode all able to be set from either the /gui/track topic or more ideally from the user gui.

The 3 follow modes are in a submenu under the right click top level menu Follow Options > and are:

  • Follow - Traditional follow mode where camera follows and tracks the same target.
    follow

  • Free Look - Enables a user to follow a target while still using an input device (IE mouse) to look around.
    follow_free_look

  • Look At - Only enabled after already selecting a primary object to follow, this allows a user to track a unique secondary target while following the primary target.
    follow_look_at

The other right click top level menu item added is Track, where the gui camera can be moved anywhere in the simulator but will always track the selected object.
track

These all respect using the escape key to stop any form of tracking.

Test it

Use these changes for collection-harmonic.yaml:

repositories:
  gz-gui:
    type: git
    url: https://github.com/rudislabs/gz-gui.git
    version: pr-track-follow
  gz-msgs:
    type: git
    url: https://github.com/rudislabs/gz-msgs.git
    version: pr-track-follow
  gz-sim:
    type: git
    url: https://github.com/rudislabs/gz-sim.git
    version: pr-track-follow

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

Signed-off-by: Benjamin Perseghetti <[email protected]>
src/gui/plugins/modules/EntityContextMenu.cc Show resolved Hide resolved
src/gui/plugins/modules/EntityContextMenu.cc Show resolved Hide resolved
src/gui/plugins/modules/EntityContextMenu.cc Outdated Show resolved Hide resolved
src/gui/plugins/modules/EntityContextMenu.cc Outdated Show resolved Hide resolved
src/gui/plugins/modules/EntityContextMenu.cc Outdated Show resolved Hide resolved
src/gui/plugins/modules/EntityContextMenu.cc Outdated Show resolved Hide resolved
src/gui/plugins/modules/EntityContextMenu.hh Outdated Show resolved Hide resolved
Co-authored-by: Alejandro Hernández Cordero <[email protected]>
Signed-off-by: Benjamin Perseghetti <[email protected]>
Signed-off-by: Benjamin Perseghetti <[email protected]>
src/gui/plugins/modules/EntityContextMenu.cc Outdated Show resolved Hide resolved
Co-authored-by: Jenn Nguyen <[email protected]>
Signed-off-by: Benjamin Perseghetti <[email protected]>
@ahcorde ahcorde added the needs upstream release Blocked by a release of an upstream library label May 20, 2024
@j-rivero
Copy link
Contributor

@osrf-jenkins run tests

1 similar comment
@bperseghetti
Copy link
Member Author

@osrf-jenkins run tests

@bperseghetti bperseghetti dismissed ahcorde’s stale review May 22, 2024 18:52

Dismissed review as all requested changes were made.

@ahcorde ahcorde merged commit 7c95f5a into gazebosim:gz-sim8 May 22, 2024
10 checks passed
@nosradom
Copy link

nosradom commented Jun 14, 2024

I accidentally upgraded to 8.4.0 today. This feature is giving me some problems.

The popup window Follow command does not seem to do anything anymore. Is there a new dependency that is needed for this to work? The 'Move To' command works but follow does not when it previously did.

Using the Right click on the Entity Tree. Then the popup window selecting the Follow Options -> Follow

I'm experimenting with using docker to run some ardupilot simulations. Below is the Dockerfile. (Rebuilding the docker image is how I accidentally upgraded).

I am using harmonic and humble

Also is there an easy way to revert to 8.3.0?

ARG ROS_DISTRO
FROM ros:${ROS_DISTRO}

ENV COLCON_WS=/root/colcon_ws
ENV COLCON_WS_SRC=/root/colcon_ws/src
ENV PYTHONWARNINGS="ignore:setup.py install is deprecated::setuptools.command.install"

ENV DEBIAN_FRONTEND noninteractive

ARG GZ_VERSION

RUN apt-get update -qq \
    && apt-get install -y \
        wget \
    && rm -rf /var/lib/apt/lists/*

RUN wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg\
    && echo "deb [arch=amd64 signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" | sudo tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null

RUN apt-get update -qq \
    && apt-get install -y \
        gz-${GZ_VERSION} \
        build-essential\
        ros-${ROS_DISTRO}-rcl-interfaces\
        ros-${ROS_DISTRO}-rclcpp\
        ros-${ROS_DISTRO}-builtin-interfaces\
        ros-${ROS_DISTRO}-ros-gz\
        ros-${ROS_DISTRO}-sdformat-urdf\
        ros-${ROS_DISTRO}-vision-msgs\
        ros-${ROS_DISTRO}-actuator-msgs\
        ros-${ROS_DISTRO}-image-transport\
    && rm -rf /var/lib/apt/lists/*

RUN mkdir -p ${COLCON_WS_SRC}\
    && cd ${COLCON_WS}\
    && . /opt/ros/${ROS_DISTRO}/setup.sh\
    && colcon build

RUN git clone --recursive --depth 1 https://github.com/ArduPilot/ardupilot_gazebo.git


RUN apt-get update \
    && apt-get install -y \
        libgz-sim8-dev \
        rapidjson-dev

RUN mkdir ardupilot_gazebo/build\
    && cd ardupilot_gazebo/build\
    && cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo

RUN cd ardupilot_gazebo/build\
    && make -j4

ENV GZ_SIM_RESOURCE_PATH=/ardupilot_gazebo/models:/ardupilot_gazebo/worlds:/models:/worlds
ENV GZ_SIM_SYSTEM_PLUGIN_PATH=/ardupilot_gazebo/build

CMD gz sim -v4 -r /ardupilot_gazebo/worlds/iris_runway.sdf

@bperseghetti
Copy link
Member Author

I accidentally upgraded to 8.4.0 today. This feature is giving me some problems.

The popup window Follow command does not seem to do anything anymore. Is there a new dependency that is needed for this to work? The 'Move To' command works but follow does not when it previously did.

Using the Right click on the Entity Tree. Then the popup window selecting the Follow Options -> Follow

I'm experimenting with using docker to run some ardupilot simulations. Below is the Dockerfile. (Rebuilding the docker image is how I accidentally upgraded).

I am using harmonic and humble

Also is there an easy way to revert to 8.3.0?

ARG ROS_DISTRO
FROM ros:${ROS_DISTRO}

ENV COLCON_WS=/root/colcon_ws
ENV COLCON_WS_SRC=/root/colcon_ws/src
ENV PYTHONWARNINGS="ignore:setup.py install is deprecated::setuptools.command.install"

ENV DEBIAN_FRONTEND noninteractive

ARG GZ_VERSION

RUN apt-get update -qq \
    && apt-get install -y \
        wget \
    && rm -rf /var/lib/apt/lists/*

RUN wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg\
    && echo "deb [arch=amd64 signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" | sudo tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null

RUN apt-get update -qq \
    && apt-get install -y \
        gz-${GZ_VERSION} \
        build-essential\
        ros-${ROS_DISTRO}-rcl-interfaces\
        ros-${ROS_DISTRO}-rclcpp\
        ros-${ROS_DISTRO}-builtin-interfaces\
        ros-${ROS_DISTRO}-ros-gz\
        ros-${ROS_DISTRO}-sdformat-urdf\
        ros-${ROS_DISTRO}-vision-msgs\
        ros-${ROS_DISTRO}-actuator-msgs\
        ros-${ROS_DISTRO}-image-transport\
    && rm -rf /var/lib/apt/lists/*

RUN mkdir -p ${COLCON_WS_SRC}\
    && cd ${COLCON_WS}\
    && . /opt/ros/${ROS_DISTRO}/setup.sh\
    && colcon build

RUN git clone --recursive --depth 1 https://github.com/ArduPilot/ardupilot_gazebo.git


RUN apt-get update \
    && apt-get install -y \
        libgz-sim8-dev \
        rapidjson-dev

RUN mkdir ardupilot_gazebo/build\
    && cd ardupilot_gazebo/build\
    && cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo

RUN cd ardupilot_gazebo/build\
    && make -j4

ENV GZ_SIM_RESOURCE_PATH=/ardupilot_gazebo/models:/ardupilot_gazebo/worlds:/models:/worlds
ENV GZ_SIM_SYSTEM_PLUGIN_PATH=/ardupilot_gazebo/build

CMD gz sim -v4 -r /ardupilot_gazebo/worlds/iris_runway.sdf

@iche033 I think this is what I mentioned to you yesterday about not having it in first but releasing a gz-sim.

@bperseghetti
Copy link
Member Author

bperseghetti commented Jun 14, 2024

@nosradom fix is incoming and should be released to binaries soon.
A release for gz-gui was needed and is here:
gazebosim/gz-gui#624

@nosradom
Copy link

@nosradom fix is incoming and should be released to binaries soon. A release for gz-gui was needed and is here: gazebosim/gz-gui#624

Awesome thanks

@bperseghetti
Copy link
Member Author

@nosradom fix is incoming and should be released to binaries soon. A release for gz-gui was needed and is here: gazebosim/gz-gui#624

Awesome thanks

Were you able to update and make sure it works properly in your environment?

@bperseghetti bperseghetti deleted the pr-track-follow branch June 21, 2024 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎵 harmonic Gazebo Harmonic needs upstream release Blocked by a release of an upstream library
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

6 participants