-
Notifications
You must be signed in to change notification settings - Fork 70
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
Adding potential new feature to pyexotica #519
Conversation
@@ -0,0 +1,33 @@ | |||
import Tkinter |
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.
New run dependency not included in the package.xml
dynamic_reconfigure was designed precisely for this purpose. Why use custom UI? |
@VladimirIvan exotica doesn't broadcast |
I like the idea but haven't been able to test it in particular. I see your issues with You can get a callback in |
This sounds like a good idea to look into. They list in the ros wiki for Two questions:
In XML: <Cost>
<Task Task="ACostTaskMap" Rho="1"/>
</Cost>
<Equality>
<Task Task="AnEqualityTaskMap"/>
</Equality> In Python: task_maps = problem.get_task_maps()
cost_task_maps = []
for k in task_maps.keys():
task_map = task_maps[k]
if task_maps[k].is_cost_term():
# True -> task map used in cost function
cost_task_maps.append(task_map)
# Now cost_task_maps is a list of 1 element
# i.e. the task map with the name "ACostTaskMap" |
Only implement what you need for your own work right now, it can always be extended later once required.
The |
What is the status of this pull request? It seems like after adding the run dependency it could be good? |
This hasn't been a priority for me for a while so I didn't look at it till now.
|
Seems Travis CI build failed. I do not know why? |
Prepend |
exotica_python/package.xml
Outdated
@@ -14,4 +14,5 @@ | |||
<depend>shape_msgs</depend> | |||
<depend>python-matplotlib</depend> | |||
<depend>python-pyassimp</depend> | |||
<depend>python-Tkinter</depend> |
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.
No, the correct key is python-tk
, cf. https://github.com/ros/rosdistro/blob/61959ac7a9d2d2bc91c0555ce139c22de428a917/rosdep/python.yaml#L4255
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.
resolved, also added python-rospkg
as per here
[exotica] added exotica icon [exotica_examples] added an example of rho tuning
Waiting for final Travis CI checks to be completed and ready to merge as far as i can tell. |
|
||
__all__=['Tuning'] | ||
|
||
class Tuning(object): |
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.
Can you please select a more descriptive name for this class, e.g., UnconstrainedEndPoseProblemInteractiveCostTuning
or InteractiveCostTuning
. As far as I can tell it now only supports costs, not constraints - and only for end-pose problems.
import Tkinter as tk | ||
import rospkg as rp | ||
|
||
__all__=['Tuning'] |
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.
PEP8 formatting (here and in the example file)
self.master.winfo_toplevel().title("Rho Tuning") | ||
|
||
# Set icon | ||
# note, rp.RosPack().get_path('exotica') throws error |
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.
Yep, because the core package is now exotica_core
and exotica
is only a metapackage - which does not work with ROS pack. A metapackage is like a stack, i.e., you can use rosstack
, cf. ros/rospack#26. So your solution is:
rp.RosStack().get_path('exotica')
|
||
# Set icon | ||
# note, rp.RosPack().get_path('exotica') throws error | ||
icon = rp.RosPack().get_path('exotica_core')[:-13] + '/exotica/doc/images/EXOTica_icon.png' |
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.
I don't like this workaround. It has some assumptions on exotica_core being next to exotica, as in our source builds. This may not hold. I have posted a fix using RosStack above.
print("Setting Rho parameters:") | ||
for k in self.cost_task_map_names: | ||
r = float(self.entries[k].get()) | ||
self.problem.set_rho(k, r) |
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.
Note: this only works for end-pose problems.
…interactive_cost_tuning [exotica_python] new features to interactive_cost_tuning * reset button: resets params to the values originally specified in .xml * math feature in entries, you can now write math in entries
|
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.
Thank you for the quick turnaround - one typo but otherwise good to go.
Thank you for adding this feature :-) |
Adding potential new feature to pyexotica
I found it frustrating having to keep stop/starting ros launch in order to tune the rho parameters for task maps. To combat this issue I implemented a script
interactive_rho_tuning.py
that allows you to tune the rho's without having to constantly stop/start. See here for an example of its use.If this sort of feature is something you would like in exotica let me know any changes/additions, otherwise feel free to close the pull request.
Checklist
code formatting: run
find -name '*.cpp' -o -name '*.h' -o -name '*.hpp' | xargs clang-format-3.9 -style=file -i
in the root directoryadd unit test(s) (NA)
ensure tests build and check results: run
catkin run_tests exotica && catkin_test_results
(NA)