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

Use trac ik 7.0 #8

Closed
wants to merge 104 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
52f447d
Squashed 'src/fanuc_sim/' content from commit 0b1e054
MikeWrock Nov 1, 2024
108c114
Merge commit '52f447d32f01e5bb4ca9a5c93dfee66b31246927' as 'src/fanuc…
MikeWrock Nov 1, 2024
3eda42b
added accessories submodule
MikeWrock Nov 1, 2024
36da3ca
Squashed 'src/lab_sim/' content from commit 2ee0461
MikeWrock Nov 1, 2024
09f2746
Merge commit '36da3ca121681609d43ab49c75afab511dfe5abe' as 'src/lab_sim'
MikeWrock Nov 1, 2024
744c9cd
Squashed 'src/moveit_pro_kinova_configs/' content from commit 178a37c
MikeWrock Nov 1, 2024
d2a7dc2
Merge commit '744c9cdd9dd2b4b1fb712454ea4f59ed4a5f8349' as 'src/movei…
MikeWrock Nov 1, 2024
3ca0158
Squashed 'src/moveit_pro_mobile_manipulation/' content from commit e5…
MikeWrock Nov 1, 2024
700d7b8
Merge commit '3ca0158f8b0b00fc6c3797983a3f77d368bf338e' as 'src/movei…
MikeWrock Nov 1, 2024
a72a9cc
Squashed 'src/moveit_pro_ur_configs/' content from commit fe3c9a7
MikeWrock Nov 1, 2024
f228848
Merge commit 'a72a9cc5bef9d30dc5139481e5be0bb9ec4539d0' as 'src/movei…
MikeWrock Nov 1, 2024
4a4d6dc
removed external dependecies from kinova config package
MikeWrock Nov 1, 2024
99a14a8
added pstop manager to ur_configs
MikeWrock Nov 1, 2024
6638821
Squashed 'src/moveit_pro_mobile_manipulation/ridgeback/' content from…
MikeWrock Nov 1, 2024
ecf4b44
Merge commit '6638821a659458a0a20042b7bd95aff025b495ff' as 'src/movei…
MikeWrock Nov 1, 2024
7a89a31
updating subtrees
MikeWrock Nov 1, 2024
7d3d6e3
Squashed 'src/ros2_robotiq_gripper/' content from commit 77e6092
MikeWrock Nov 1, 2024
723e978
Merge commit '7d3d6e355f22068b04008623d8a6dd4347c65a5f' as 'src/ros2_…
MikeWrock Nov 1, 2024
0f778d6
rearranging external dependencies
MikeWrock Nov 1, 2024
8907cf0
Merge commit '8d2987287e9b1c4a7e64593f59e414aaafe8c448' as 'src/exter…
MikeWrock Nov 1, 2024
8d29872
Squashed 'src/external_dependencies/ros2_robotiq_gripper/' content fr…
MikeWrock Nov 1, 2024
6fe6aeb
Squashed 'src/external_dependencies/ridgeback/' content from commit 3…
MikeWrock Nov 1, 2024
001ffeb
Merge commit '6fe6aeb8c19009b66ad614e9d3e1cc113ae96e58' as 'src/exter…
MikeWrock Nov 1, 2024
771a78e
Squashed 'src/external_dependencies/serial/' content from commit d8d1606
MikeWrock Nov 1, 2024
9942dd2
Merge commit '771a78eb7050677f38e927cec6109daaa96276a5' as 'src/exter…
MikeWrock Nov 1, 2024
0304f33
Squashed 'src/external_dependencies/ros2_robotiq_gripper/' changes fr…
MikeWrock Nov 1, 2024
393838e
Merge commit '0304f331642e13973942e39a38c44c9e4e3ccec3' into subtree
MikeWrock Nov 1, 2024
223d75d
Squashed 'src/picknik_registration/' content from commit 220e5c9
MikeWrock Nov 2, 2024
3ff1db7
Merge commit '223d75d81b631439cd1200139786061f3f66a8ef' as 'src/pickn…
MikeWrock Nov 2, 2024
d0dad84
Squashed 'src/example_behaviors/' content from commit d1451e3
MikeWrock Nov 4, 2024
44eed6f
Merge commit 'd0dad846098656d674ed23e4706ef933136561cc' as 'src/examp…
MikeWrock Nov 4, 2024
1e42730
Added mtc to jtc converter
MikeWrock Nov 5, 2024
0a553e9
Add pick and place example using custom MTC example behavior
bgill92 Nov 5, 2024
ca4a3f5
Merge pull request #1 from PickNikRobotics/add-custom-pick-and-place-…
MikeWrock Nov 6, 2024
4b7b987
inore .vscode/
MikeWrock Nov 11, 2024
7669d52
Updated README
MikeWrock Nov 12, 2024
05e796e
Moving registration behaviors
MikeWrock Nov 12, 2024
8023df2
Merge pull request #3 from PickNikRobotics/registration
MikeWrock Nov 12, 2024
6118d12
pre-commit formatting
MikeWrock Nov 12, 2024
4f1bec3
formatting
MikeWrock Nov 12, 2024
454dcac
Merge pull request #4 from PickNikRobotics/formatting
MikeWrock Nov 12, 2024
8e66984
formatting
MikeWrock Nov 12, 2024
75ef8e3
formatting
MikeWrock Nov 12, 2024
217a42e
removed accidental objectives
MikeWrock Nov 12, 2024
4a7aa99
Merge pull request #5 from PickNikRobotics/pre-commit-formatting
MikeWrock Nov 12, 2024
f68f9be
Updating xacro and favourites
MikeWrock Nov 14, 2024
350c75b
Merge pull request #7 from PickNikRobotics/xacro-update
MikeWrock Nov 15, 2024
4d3bdd2
version bump
MikeWrock Nov 15, 2024
c99eeb4
bumping accessories version
MikeWrock Nov 15, 2024
6f581ce
Fix depend of moveit_studio_behavior
pac48 Nov 18, 2024
15baa7f
Update ports explicitly
bgill92 Nov 18, 2024
9b97cd4
Fix pick ApriTag object
pac48 Nov 18, 2024
d43221b
Merge pull request #12 from PickNikRobotics/fix-pick-apriTag-object
MikeWrock Nov 18, 2024
41dd3ea
Merge pull request #11 from PickNikRobotics/fix-example-behaviors-pac…
MikeWrock Nov 18, 2024
ad79604
update submodule
pac48 Nov 18, 2024
636ce5c
Merge pull request #13 from PickNikRobotics/pr-update-submodule-pickn…
MikeWrock Nov 18, 2024
cb35f90
Merge branch 'main' into pr-update-to-make-ports-explicit
MikeWrock Nov 18, 2024
b090cff
more fixes
MikeWrock Nov 18, 2024
23d20c4
formatting
MikeWrock Nov 18, 2024
9093cfb
Merge pull request #10 from PickNikRobotics/pr-update-to-make-ports-e…
MikeWrock Nov 18, 2024
dd4d494
Updating objectives
MikeWrock Nov 20, 2024
c6ac354
Removes visualization pane changes in teleoperation
MikeWrock Nov 21, 2024
d275f6f
removed erroneous objective
MikeWrock Nov 21, 2024
4591c5a
added descriptions
MikeWrock Nov 21, 2024
792bb71
Merge pull request #15 from PickNikRobotics/objective-fixes
MikeWrock Nov 21, 2024
3c742bb
Added arm_on_rail (#17)
MikeWrock Nov 25, 2024
026e50b
Mm sync (#18)
MikeWrock Nov 25, 2024
72d0bea
making sync script executable
MikeWrock Nov 25, 2024
43db145
removed ui changes (#14)
MikeWrock Nov 25, 2024
9cfc575
Subtree sync (#19)
MikeWrock Nov 25, 2024
632bc53
updating picknik_accesories
MikeWrock Nov 28, 2024
878d137
patching fanuc (#22)
MikeWrock Dec 2, 2024
6e9547c
added dependency (#21)
MikeWrock Dec 2, 2024
3cb843a
Sync V6.5 to main (#29)
MikeWrock Dec 3, 2024
0d346ab
Remove
dsobek Dec 4, 2024
b163653
Add example SAM 2 behavior and objective (#23)
pac48 Dec 4, 2024
a657adf
Sync 6.5 to main (#37)
MikeWrock Dec 5, 2024
1f0f61b
Sam naming (#38)
MikeWrock Dec 5, 2024
6ee92c2
fixed build and test for example behaviors (#39)
MikeWrock Dec 6, 2024
a41a1d1
Syncing subtrees
MikeWrock Dec 6, 2024
8e81e3a
Subtree sync (#41)
MikeWrock Dec 6, 2024
7400d44
Merge pull request #34 from PickNikRobotics/merge-compose
dsobek Dec 6, 2024
d532049
Revert "Remove `docker-compose.yaml`"
dsobek Dec 10, 2024
e511305
Merge pull request #43 from PickNikRobotics/revert-34-merge-compose
dsobek Dec 10, 2024
4f40bad
Merge v7.0 into main (#58)
marioprats Dec 13, 2024
c352121
Remove unused pick_ik dependency
dyackzan Dec 17, 2024
700918e
Merge pull request #61 from PickNikRobotics/remove-unused-pick-ik-dep
dyackzan Dec 17, 2024
499ce88
added apriltag objectives (#60)
MikeWrock Dec 18, 2024
9a19d46
More detailed Objective description (#45)
davetcoleman Dec 18, 2024
bf9048c
Update Objective description (#46)
davetcoleman Dec 18, 2024
c20d519
Expand description of objective (#47)
davetcoleman Dec 18, 2024
3084b0e
Make Pro-RRT the default in all configs
marioprats Dec 18, 2024
17eb85f
Merge pull request #63 from PickNikRobotics/pro-rrt-default
dyackzan Dec 30, 2024
06eecdc
Update ForEach[Type] -> ForEach
dyackzan Dec 23, 2024
c708a09
Reduce the poses used in PlanAndSaveTrajectory
dyackzan Dec 31, 2024
ac7ba42
Merge pull request #64 from PickNikRobotics/update-deprecated-for-eac…
MikeWrock Jan 1, 2025
6a4253c
Add docker-compose.yaml template and include example of usage
dsobek Dec 6, 2024
1abbd38
use slik as the pose IK solver in all configs, remove deps to trac_ik
marioprats Nov 25, 2024
bc5ca6b
rename slik -> pose_ik
marioprats Dec 5, 2024
3c6205e
Find and replace everything ForEach\w+ to just ForEach
dsobek Dec 31, 2024
631159a
Merge pull request #68 from PickNikRobotics/v7.0
dsobek Jan 1, 2025
cc49b8b
Merge pull request #67 from PickNikRobotics/reduce-poses-for-mtc-plan
MikeWrock Jan 1, 2025
43d9987
Merge pull request #70 from PickNikRobotics/main
MikeWrock Jan 1, 2025
dce5616
Use trac ik again to resolve performance regression in `SetupMTCMoveT…
dyackzan Jan 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.onnx filter=lfs diff=lfs merge=lfs -text
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
build/
install/
log/
.vscode/
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "src/picknik_accessories"]
path = src/picknik_accessories
url = https://github.com/PickNikRobotics/picknik_accessories.git
[submodule "src/external_dependencies/trac_ik"]
path = src/external_dependencies/trac_ik
url = [email protected]:traclabs/trac_ik.git
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# pre-commit autoupdate
#
# See https://github.com/pre-commit/pre-commit
exclude: ^src/external_dependencies/
repos:
# Standard hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand Down
27 changes: 15 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ ARG MOVEIT_STUDIO_BASE_IMAGE
ARG USERNAME=studio-user
ARG USER_UID=1000
ARG USER_GID=1000
ARG BASE=base

##################################################
# Starting from the specified MoveIt Pro release #
##################################################
# The image tag is specified in the argument itself.
# hadolint ignore=DL3006
FROM ${MOVEIT_STUDIO_BASE_IMAGE} AS base
FROM ${MOVEIT_STUDIO_BASE_IMAGE} AS base-base

# Create a non-root user
ARG USERNAME
Expand Down Expand Up @@ -49,18 +50,20 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
/home/${USERNAME}/.ros && \
chown -R $USER_UID:$USER_GID /home/${USERNAME} /opt/overlay_ws/

# IMPORTANT: Optionally install Nvidia drivers for improved simulator performance with Nvidia GPUs.
# To do this you must
# 1. Uncomment the ENV and RUN entries below
# 2. Replace the 'nvidia-driver-555' apt package with the Nvidia driver version on your host, e.g. nvidia-driver-535, nvidia-driver-555. Use nvidia-smi on your host to determine the driver version.
# After rebuilding via `moveit_pro build` verify the drivers are active in your container by running `nvidia_smi` inside of `moveit_pro shell`.
# ENV DEBIAN_FRONTEND=noninteractive
# RUN apt update && apt install -y software-properties-common
# RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
# --mount=type=cache,target=/var/lib/apt,sharing=locked \
# add-apt-repository ppa:graphics-drivers/ppa && \
# apt update && apt upgrade -y && apt install -y nvidia-driver-555
FROM base-base AS base-nvidia
ARG NVIDIA_DRIVER_PACKAGE
ENV DEBIAN_FRONTEND=noninteractive
# hadolint ignore=DL3008
RUN apt-get update && apt-get install -y --no-install-recommends software-properties-common
# hadolint ignore=DL3008
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
add-apt-repository ppa:graphics-drivers/ppa && \
apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends "${NVIDIA_DRIVER_PACKAGE}"

ARG BASE
# hadolint ignore=DL3006
FROM base-${BASE} AS base
# Install additional dependencies
# You can also add any necessary apt-get install, pip install, etc. commands at this point.
# NOTE: The /opt/overlay_ws folder contains MoveIt Pro binary packages and the source file.
Expand Down
65 changes: 61 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,64 @@
# MoveIt Pro Workspace
# MoveIt Pro Example Workspace

This is a minimal user workspace that can be used to build customized MoveIt Pro workspaces.
This is fork of the [MoveIt Pro Empty Workspace](https://github.com/PickNikRobotics/moveit_pro_empty_ws).
This workspace contains reference materials for using MoveIt Pro, including:
- [Example base UR5e configuration](src/moveit_pro_ur_configs/picknik_ur_base_config)
- [A physics based simulation environment with a robot on a linear rail](src/lab_sim)
- [Mobile manipulation configuration](src/moveit_pro_mobile_manipulation/picknik_ur_mobile_config)
- [Example behaviors](src/example_behaviors)

You may fork this repository and add the MoveIt Pro configurations and ROS 2 packages of your choosing to the `src` folder.
Since the [picknik_accessories](https://github.com/PickNikRobotics/picknik_accessories) package uses git LFS, [it cannot be added as a subtree](https://github.com/git-lfs/git-lfs/issues/854).
Please ensure you have the submodule up to date using:
```bash
git submodule update --recursive --init
```

For more information, refer to the [MoveIt Pro Documentation](https://docs.picknik.ai/).
## Working with Git Subtrees

This repository was created through the combination of multiple repositories using git subtree.
If you have no interest in manually pulling or pushing upstream changes, you can ignore the following section and treat this repository as a single repository.

### Repository Structure


The structure of this repository is as follows:

<pre>
.
├── <a href="README.md">README.md</a>
└── src
├── <a href="https://github.com/PickNikRobotics/example_behaviors">example_behaviors</a>
├── <a href="https://github.com/PickNikRobotics/lab_sim">lab_sim</a>
├── <a href="https://github.com/PickNikRobotics/moveit_pro_ur_configs">moveit_pro_ur_configs</a>
│ ├── picknik_ur_base_config
│ ├── picknik_ur_mock_hw_config
│ ├── picknik_ur_multi_arm_config
│ ├── picknik_ur_sim_config
│ └── picknik_ur_site_config
├── <a href="https://github.com/PickNikRobotics/moveit_pro_kinova_configs">moveit_pro_kinova_configs</a>
│ ├── kinova_gen3_base_config
│ ├── kinova_gen3_mujoco_config
│ └── moveit_studio_kinova_pstop_manager
├── <a href="https://github.com/PickNikRobotics/moveit_pro_mobile_manipulation">moveit_pro_mobile_manipulation</a>
│ ├── mobile_manipulation_config
│ └── picknik_ur_mobile_config
├── <a href="https://github.com/PickNikRobotics/fanuc_sim">fanuc_sim</a>
├── <a href="https://github.com/PickNikRobotics/picknik_accessories">picknik_accessories</a> (submodule)
└── external_dependencies
├── <a href="https://github.com/sjahr/ridgeback/tree/ros2">ridgeback</a>
├── <a href="https://github.com/PickNikRobotics/ros2_robotiq_gripper">ros2_robotiq_gripper</a>
└── <a href="https://github.com/tylerjw/serial/tree/ros2">serial</a>
</pre>

This repository contains a **copy** of the git repositories that were added as subtrees.
File changes and commits are treated as if they happen only in this repository.
If you update the contents of a subtree, you can merge the latest `main` branch of [lab_sim](https://github.com/PickNikRobotics/lab_sim) using the following command:
```bash
git subtree pull --prefix src/lab_sim https://github.com/PickNikRobotics/lab_sim main --squash
```

To pull the upstream changes to all subtrees and submodules, a convenience script is provided.
From the top level, you can execute:
```bash
./sync_subtrees.sh
```
70 changes: 70 additions & 0 deletions src/example_behaviors/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
cmake_minimum_required(VERSION 3.22)
project(example_behaviors CXX)

find_package(moveit_studio_common REQUIRED)
find_package(example_interfaces REQUIRED)
moveit_studio_package()

set(THIS_PACKAGE_INCLUDE_DEPENDS moveit_studio_behavior moveit_studio_behavior_interface pluginlib
moveit_studio_vision
moveit_studio_vision_msgs
PCL
pcl_conversions
pcl_ros
example_interfaces)
foreach(package IN ITEMS ${THIS_PACKAGE_INCLUDE_DEPENDS})
find_package(${package} REQUIRED)
endforeach()
find_package(moveit_pro_ml REQUIRED)

add_library(
example_behaviors
SHARED
src/example_add_two_ints_service_client.cpp
src/example_convert_mtc_solution_to_joint_trajectory.cpp
src/example_delayed_message.cpp
src/example_get_string_from_topic.cpp
src/example_fibonacci_action_client.cpp
src/example_hello_world.cpp
src/example_publish_color_rgba.cpp
src/example_setup_mtc_pick_from_pose.cpp
src/example_setup_mtc_place_from_pose.cpp
src/example_setup_mtc_wave_hand.cpp
src/example_ndt_registration.cpp
src/example_ransac_registration.cpp
src/example_sam2_segmentation.cpp
src/register_behaviors.cpp)
target_include_directories(
example_behaviors
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
PRIVATE ${PCL_INCLUDE_DIRS})
ament_target_dependencies(example_behaviors
${THIS_PACKAGE_INCLUDE_DEPENDS})
target_link_libraries(example_behaviors onnx_sam2)

# Install Libraries
install(
TARGETS example_behaviors
EXPORT example_behaviorsTargets
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
INCLUDES
DESTINATION include)

install(DIRECTORY config models DESTINATION share/${PROJECT_NAME})

if(BUILD_TESTING)
moveit_pro_behavior_test(example_behaviors)
endif()

# Export the behavior plugins defined in this package so they are available to
# plugin loaders that load the behavior base class library from the
# moveit_studio_behavior package.
pluginlib_export_plugin_description_file(
moveit_studio_behavior_interface example_behaviors_plugin_description.xml)

ament_export_targets(example_behaviorsTargets HAS_LIBRARY_TARGET)
ament_export_dependencies(${THIS_PACKAGE_INCLUDE_DEPENDS})
ament_package()
Empty file.
1 change: 1 addition & 0 deletions src/example_behaviors/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# example_behaviors
4 changes: 4 additions & 0 deletions src/example_behaviors/behavior_plugin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
objectives:
behavior_loader_plugins:
example_behaviors:
- "example_behaviors::ExampleBehaviorsLoader"
6 changes: 6 additions & 0 deletions src/example_behaviors/config/tree_nodes_model.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<root>
<TreeNodesModel>
<!-- Include additional SubTree metadata in this file. -->
</TreeNodesModel>
</root>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<library path="example_behaviors">
<class
type="example_behaviors::ExampleBehaviorsLoader"
base_class_type="moveit_studio::behaviors::SharedResourcesNodeLoaderBase"
/>
</library>
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#pragma once

#include <moveit_studio_behavior_interface/service_client_behavior_base.hpp>
#include <example_interfaces/srv/add_two_ints.hpp>

using moveit_studio::behaviors::BehaviorContext;
using moveit_studio::behaviors::ServiceClientBehaviorBase;
using AddTwoInts = example_interfaces::srv::AddTwoInts;

namespace example_behaviors
{
class ExampleAddTwoIntsServiceClient final : public ServiceClientBehaviorBase<AddTwoInts>
{
public:
ExampleAddTwoIntsServiceClient(const std::string& name, const BT::NodeConfiguration& config,
const std::shared_ptr<BehaviorContext>& shared_resources);

/** @brief Implementation of the required providedPorts() function for the hello_world Behavior. */
static BT::PortsList providedPorts();

/**
* @brief Implementation of the metadata() function for displaying metadata, such as Behavior description and
* subcategory, in the MoveIt Studio Developer Tool.
* @return A BT::KeyValueVector containing the Behavior metadata.
*/
static BT::KeyValueVector metadata();

private:
/** @brief User-provided function to get the name of the service when initializing the service client. */
tl::expected<std::string, std::string> getServiceName() override;

/**
* @brief User-provided function to create the service request.
* @return Returns a service request message. If not successful, returns an error message. Note that the criteria for
* success or failure is defined by the user's implementation of this function.
*/
tl::expected<AddTwoInts::Request, std::string> createRequest() override;

/** @brief Optional user-provided function to process the service response after the service has finished. */
tl::expected<bool, std::string> processResponse(const AddTwoInts::Response& response) override;

/** @brief Classes derived from AsyncBehaviorBase must implement getFuture() so that it returns a shared_future class member */
std::shared_future<tl::expected<bool, std::string>>& getFuture() override
{
return future_;
}

/** @brief Classes derived from AsyncBehaviorBase must have this shared_future as a class member */
std::shared_future<tl::expected<bool, std::string>> future_;
};
} // namespace example_behaviors
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#pragma once

#include <Eigen/Core>
#include <behaviortree_cpp/action_node.h>
#include <behaviortree_cpp/bt_factory.h>
#include <moveit/robot_model_loader/robot_model_loader.h>
#include <moveit_msgs/msg/robot_trajectory.hpp>
#include <moveit_studio_behavior/utils/trajectory_utils.hpp>
#include <moveit_studio_behavior_interface/behavior_context.hpp>
#include <moveit_studio_behavior_interface/check_for_error.hpp>
#include <moveit_studio_behavior_interface/shared_resources_node.hpp>
#include <moveit_task_constructor_msgs/msg/solution.hpp>
#include <spdlog/spdlog.h>
#include <trajectory_msgs/msg/joint_trajectory.hpp>
#include <yaml-cpp/yaml.h>

namespace example_behaviors
{
/**
* @brief Converts a MoveIt Task Constructor Solution into a JointTrajectory.
*
* @details
* | Data Port Name | Port Type | Object Type |
* | ----------------- |---------------|---------------------------------------------------------|
* | solution | Input | moveit_task_constructor_msgs::msg::Solution |
* | joint_group | Input | std::string |
* | velocity_scaling_factor | Input | double |
* | acceleration_scaling_factor | Input | double |
* | sampling_rate | Input | int |
* | joint_trajectory | Output | trajectory_msgs::msg::JointTrajectory |
*/
class ExampleConvertMtcSolutionToJointTrajectory final : public moveit_studio::behaviors::SharedResourcesNode<BT::SyncActionNode>
{
public:
ExampleConvertMtcSolutionToJointTrajectory(const std::string& name, const BT::NodeConfiguration& config,
const std::shared_ptr<moveit_studio::behaviors::BehaviorContext>& shared_resources);

static BT::PortsList providedPorts();

static BT::KeyValueVector metadata();

BT::NodeStatus tick() override;

private:
std::unique_ptr<robot_model_loader::RobotModelLoader> robot_model_loader_;

const std::vector<Eigen::VectorXd>& extractJointPositions(const moveit_task_constructor_msgs::msg::Solution& solution);
};
} // namespace example_behaviors
Loading
Loading