-
Notifications
You must be signed in to change notification settings - Fork 9
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
Scripts for auto-generating robot packages #3
Scripts for auto-generating robot packages #3
Conversation
… in template files
… order for templates
@gavanderhoorn, can you review? |
An example of how to utilize this package for specific vendors can be found here. |
Will do, but later this week, if ok. |
project(industrial_robot_pkg_gen) | ||
|
||
find_package(catkin REQUIRED COMPONENTS | ||
xacro |
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.
add rospy
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.
But only if you actually use it, obviously.
<rosparam command="load" file="$(find @(package))/config/joint_names_@(model).yaml" /> | ||
|
||
<include file="$(find @[if prefix]@(prefix)_driver@[else]driver@[end if])/launch/robot_state.launch"> | ||
<arg name="robot_ip" value="$(arg robot_ip)" /> |
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.
Extraneous whitespace.
Visual review: this looks ok. General comments:
|
Thanks for taking the time to review.
Agreed, I will fix (thanks for pointing them out in the source comments)
I'm not sure where we draw the line. I've always used namespacing as you suggested in your comments. I'm inclined to keep it that way, but if you can come up with a good reason to use anonymous names, let me know.
Agreed
Agreed. I'm open to suggestions here. I tried to avoid an explicit reliance on rospy, but I had trouble finding a terminal printing library that would emphasis the TODOs (this was the best i found ) Finally, I think I will change the options hierarchy. The current script has global options and sub-command options. This breaks up the help text and is not like any other ROS script I can find. |
no problem. Trying to run this today, with the following command line: rosrun industrial_robot_pkg_gen package_generator support m123ijk5g [email protected] Results in the following trace: Namespace(author=None, email='[email protected]', func=<bound method SupportSubCmd._execute of <industrial_robot_pkg_gen.cmd_line_interface.SupportSubCmd instance at 0xb726162c>>, model='m123ijk5g', num_joints=6, pkg_vers='0.0.1', prefix=None, t_paths=['industrial_robot_pkg_gen/resources'])
Template path(s): ['/home/user/ros/ws/src/industrial_experimental/industrial_robot_pkg_gen/resources']
Generating support directories for model: m123ijk5g
Traceback (most recent call last):
File "/home/user/ros/ws/src/industrial_experimental/industrial_robot_pkg_gen/scripts/package_generator", line 11, in <module>
cli.run()
File "/home/user/ros/ws/src/industrial_experimental/industrial_robot_pkg_gen/src/industrial_robot_pkg_gen/cmd_line_interface.py", line 38, in run
args.func(args)
File "/home/user/ros/ws/src/industrial_experimental/industrial_robot_pkg_gen/src/industrial_robot_pkg_gen/cmd_line_interface.py", line 98, in _execute
generator.generate_package(args.prefix, args.model, args.num_joints, args.author, args.email, args.pkg_vers, template_paths)
File "/home/user/ros/ws/src/industrial_experimental/industrial_robot_pkg_gen/src/industrial_robot_pkg_gen/generators.py", line 63, in generate_package
em_params = self._load_em_params(package, model, num_joints, author, author_email, version, prefix)
File "/home/user/ros/ws/src/industrial_experimental/industrial_robot_pkg_gen/src/industrial_robot_pkg_gen/generators.py", line 110, in _load_em_params
em.expand('@{prefix = "' + prefix + '"}', em_params)
TypeError: cannot concatenate 'str' and 'NoneType' objects
yes, the current setup is a bit unintuitive. I had to look twice where the |
Also: I'm guessing this is currently 'debug' level output, but I think the "loading .. outputting .. generating .." text is a bit much. Perhaps some sort of summary at the end? "Generated N files, support package directory: /path/to/pkg/dir". |
template_paths = self._eval_t_paths(args.t_paths) | ||
|
||
# Author email used in place of empty author name | ||
if(not args.author): args.author = args.email |
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.
Might be an idea to only use the part of the email address before the @. fi: [email protected] -> author = k.c.jones
.
… directory exists
@gavanderhoorn, please approve. Unaddressed items have been added to issue #4. |
+1....needed for ROSCon, so I'm merging myself. |
Scripts for auto-generating robot packages
Sorry about that, I was OoO. Will do a post-merge review next week. |
Initial PR for robot package generation scripts. See package README for a quick tutorial. Remaining items (not included in this PR)