-
Notifications
You must be signed in to change notification settings - Fork 6
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
Launch packages from HMI display menu Entry "My Program" #13
base: main
Are you sure you want to change the base?
Conversation
[TODO] Launch multiple launch files one after the other |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something seems really fishy here. I think you may have over-complicating or over-thinking how this could happen. Alternatively I may not have a sufficient understanding of the situation.
I found a few things I think are suspect:
- I don't understand why this PR has copies of an existing package's messages.
- It is unclear to me why you are using subprocess to kick off a launch file.
- Is there a second pull request that updates the turtlebot4 menu with menu options?
- How are students supposed to add their project to this node.
I don't understand why we can't make a set of simple menu items on the TurtleBot screen and those options issue a message. On the lesson side a simple node that listens for those messages and triggers a student project (using a message / service call/ or action call) should be sufficient.
Let's find some time to chat on Monday.
projects/hmi_simulation_project_manager/hmi_simulation_project_manager/manager.py
Show resolved
Hide resolved
# Then return Success message upon successful request exectution | ||
if(request.my_program_on): | ||
self.get_logger().info('My Program Mode is turned on') | ||
subprocess.call(["bash", '/home/sumedh/workspace/src/TurtleBot4Lessons/projects/hmi_simulation_project_manager/config/auto_launch.bash']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uhhhhhhhhhhhh. This is a hard coded path. I am not sure how I feel about calling subprocess to run a script from inside a node.
Did you follow this pattern from someone else? At bare minimum the bath needs to be relative.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed the hardcode path. I generally prefer going with relative path. However, the relative path isnt working. Hence, during testing, I used the complete path. In my recent commits, I changed it to relative path.
Yes, calling subprocess to run a script is possible and is friendly. Please refer to one of the implementation by Tully foote and Alejandro in one of their repo's.
https://github.com/osrf/drone_demo/blob/master/sitl_launcher/scripts/launch_drone_ros2.py
Please refer to line number 172
@@ -0,0 +1,29 @@ | |||
from setuptools import setup |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is unclear to me what this is for. Why does a ROS node need a setup.py file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please refer to https://docs.ros.org/en/galactic/Tutorials/Intermediate/Launch/Launch-system.html. This import is an inbuilt packages used to setup the ROS2 package. This is generated when we create a new ROS2 package ros2 pkg create --build-type ament_python <package_name>
@@ -0,0 +1,76 @@ | |||
from asyncio import FastChildWatcher | |||
import string | |||
from tkinter.messagebox import NO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You seem to have a lot of extra import statements that aren't used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These imports seems to be like auto generated by visual studio code. I will remove them
description='Goal position in X and Y coordinates')] | ||
|
||
|
||
def generate_launch_description(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding of launch isn't that great. Can you explain a bit about what is going on here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, In this example, as a sample I am firing Nodes required for running motion planner algorithm. The TODO is that the program manager launch will make sure to maintain a queue of all student packages. Which inturn executes one by one in the Queue. This needs to be discussed on how to architect it.
I removed the turtlebot4_msgs from the projects folder. That was an uncertain commit. |
Please refer to the below pull request |
This PR enables users to launch their program/ programs from HMI display of TB4 by pressing "My Program" on the available menu list.
Usage:
Note:
Add Menu Entry to HMI display "My Program" turtlebot4#24