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

ROS1 Update #3

Merged
merged 3 commits into from
Jan 17, 2024
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: 0 additions & 4 deletions .github/workflows/clang_format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ on:
branches:
- master
pull_request:
paths:
- 'snp**'
- '.github/workflows/clang_format.yml'
- '**clang-format'
schedule:
- cron: '0 5 * * *'

Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/cmake_format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ on:
branches:
- master
pull_request:
paths:
- 'snp**'
- '.github/workflows/cmake_format.yml'
- '**cmake-format'
schedule:
- cron: '0 5 * * *'

Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@ install(
RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION})

install(DIRECTORY include/${PROJECT_NAME}/ DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION})

install(DIRECTORY launch DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
install(FILES plugin_description.xml DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Trajectory Preview

ROS-enabled Qt widget and Rviz panel for interactively previewing robot trajectories

![Trajectory preview panel](docs/panel.png)

## Usage
The widget subscribes to a `trajectory_msgs/JointTrajectory` definition of a robot trajectory and
publishes a `sensor_msgs/JointState` message corresponding to the state in the trajectory at which the slider is set.

An Rviz `RobotModel` display can then be used to visualize the preview using the following pipeline:
- The trajectory preview widget publishes joint states (`/trajectory/joint_states`)
- A `JointStatePublisher` node integrates the trajectory preview widget joint states topic (`/trajectory/joint_states`) into a constantly published joint states topic (`/preview/joint_states`)
- A `RobotStatePublisher` node subscribes to the high-level preview joint states topic (`/preview/joint_states`) and creates a TF tree with the prefix `preview`
- The Rviz `RobotModel` display animates the robot model using the `preview`-prefixed TF tree

This pipeline is provided in the `robot_model_preview_pipeline.launch.xml` file

## Build
```commandLine
cd <ws>
rosdep install --from-paths src -iry
colcon build
```
Binary file added docs/panel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions launch/robot_model_preview_pipeline.launch.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0."?>
<launch>
<arg name="root_frame" doc="Root frame of the nominal TF tree, at which to connect the preview TF tree" />
<arg name="prefix" default="preview"/>

<node pkg="joint_state_publisher" type="joint_state_publisher" name="$(arg prefix)_joint_state_publisher">
<remap from="joint_states" to="$(arg prefix)/joint_states"/>
<rosparam param="source_list">[trajectory/joint_states]</rosparam>
</node>

<node pkg="robot_state_publisher" type="robot_state_publisher" name="$(arg prefix)_robot_state_publisher">
<remap from="joint_states" to="$(arg prefix)/joint_states"/>
<param name="tf_prefix" value="$(arg prefix)"/>
</node>

<node pkg="tf2_ros" type="static_transform_publisher" args="0 0 0 0 0 0 $(arg root_frame) preview/$(arg root_frame)" name="$(arg prefix)_static_tf2_pub"/>

</launch>
3 changes: 3 additions & 0 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
<depend>trajectory_msgs</depend>
<depend>libqt5-widgets</depend>
<depend>qtbase5-dev</depend>
<exec_depend>joint_state_publisher</exec_depend>
<exec_depend>robot_state_publisher</exec_depend>
<exec_depend>tf2_ros</exec_depend>

<export>
<rviz plugin="${prefix}/plugin_description.xml"/>
Expand Down
Loading