Skip to content

GUI controls as ROS 2 rqt plugin #10

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

Open
wants to merge 2 commits into
base: ros2
Choose a base branch
from

Conversation

jkaniuka
Copy link

Motivation

Hi, I have been using PyBullet in my engineering thesis and recently noticed that you have made the ROS-PyBullet Interface code available. I was very comfortable using Pybullet, but at the time I was surprised why it was not available as a ROS package. I see that the ROS 2 branch is in early development, so I decided to add something from myself.

Description

I took care of the GUI implementation in the form of the rqt plugin. The reference point for me was the rpbi_controls_node.py file from main branch of ros_pybullet_interface repository.

  • When the Start, Step, or Stop button is pressed, an attempt is made to connect to the corresponding service server. The GUI code using the tkinter library used the get_srv_handler() function from the custom_ros_tools package. I created an analogous function so as not to immediately rewrite the entire custom_ros_tools repository to ROS 2.
  • Pressing the Send button does nothing. This is because the value of the robot_name parameter is used when handling the press event of this button. In ROS 2 the concept of parameters has been completely changed. There is no global parameter anymore. Each parameter is specific to a node. This issue requires careful consideration.

Screenshot

image

How to run

  1. In the root of your workspace build ros_pybullet_rqt_plugin package and source setup file.
colcon build --packages-select ros_pybullet_rqt_plugin
. install/setup.bash
  1. Refresh rqt cache memory to make the plugin visible (details can be found here)
rqt --force-discover
  1. You can run the GUI in one of three ways:
    • Open rqt (use rqt command) and navigate to Plugins ➡️ Introspection ➡️ PyBullet Interface Controls
    • Start only this plugin using -s (standalone) flag
    rqt -s ros_pybullet_rqt_plugin
    
    • Open GUI as a ROS 2 node:
    ros2 run ros_pybullet_rqt_plugin ros_pybullet_rqt_plugin 
    

My setup

  • Ubuntu 22.04
  • ROS 2 Humble Hawksbill
  • Python 3.10.6

Tools used in the development

  • Qt 5 Designer - I used this tool to design the graphical interface of the plugin

How to test

You can test whether the status information is displayed correctly by publishing a message on the rpbi/status topic.

ros2 topic pub /rpbi/status -1 std_msgs/msg/Int64 "{data: 1}"

@cmower
Copy link
Member

cmower commented Feb 28, 2023

Thanks for the contribution @jkaniuka! I am a bit short on time, but will try to find some over the next few weeks to look into this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants