-
Notifications
You must be signed in to change notification settings - Fork 1
Working Trajopt #1
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
base: master
Are you sure you want to change the base?
Conversation
BryceStevenWilley
left a comment
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.
Just some initial thoughts, most comments you can ignore until this is ready for a full review, but most of the comments on the TrajOpt interface document are important.
moveit_planners/trajopt/trajopt_interface_plugin_description.xml
Outdated
Show resolved
Hide resolved
| CartPoseErrCalculator(const Eigen::Isometry3d& pose, | ||
| const planning_scene::PlanningSceneConstPtr planning_scene, | ||
| std::string link, | ||
| Eigen::Isometry3d tcp = Eigen::Isometry3d::Identity()) |
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.
tcp is usused, should be added to the target_pose_inv * iteration_new_pose expression below.
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 am not sure about using tcp as I am using getGlobalLinkTransform to get the global transform of the end-effector. I will investigate this more when I try to add Cartesian pose constraint
| // Create place pose constraint | ||
| std::shared_ptr<trajopt_interface::JointPosTermInfo> joint_pos(new trajopt_interface::JointPosTermInfo); | ||
| joint_pos->term_type = trajopt::TT_CNT; | ||
| joint_pos->name = "joint pose name ^_^"; |
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.
😆
| moveit::core::RobotState start_state(planning_scene->getCurrentState()); | ||
| moveit::core::robotStateMsgToRobotState(req.start_state, start_state); | ||
| // This function converts the moveit_msgs::RobotState (from req.start_state) to moveit::core::RobotState (start_state). | ||
| start_state.update(); |
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.
Your PR comment mentions that the start state is not set. How is anything working if you don't set the start state? If you are only setting the goals state, then none of the trajectories you get should be feasible.
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 meant the start state as a constraint for trajopt as we talked in the previous meeting.
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.
Ah, I see. I think I misunderstood what you meant by 'somewhat working': I assumed that you had gotten valid trajectories on some examples and had fixed the issue we talked about on Thursday.
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 added the the start state as a constraint too.
This seems like a really important detail to understand. Have you been able to read through its behavior in Tesseract to understand what it does? Maybe @Levi-Armstrong could quickly shed some light on this variable |
davetcoleman
left a comment
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 share relevant diagrams explaining the relationship of the files / classes in this PR?
| @@ -0,0 +1,14 @@ | |||
| trajopt_param: | |||
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 add comments explaining what each of these parameters do, so that reviewers can better understand this PR
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 may want to cite the publication / note the paper's notation in the comments
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.
yaml file is the right place to put the citation or it should be in another 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.
sorry, i didn't mean cite the paper, i meant explain how these parameters relate to what were presented in the original research, since the var names probably differ
| * @brief Used to calculate the error for StaticCartPoseTermInfo | ||
| * This is converted to a cost or constraint using TrajOptCostFromErrFunc or TrajOptConstraintFromErrFunc | ||
| */ | ||
| struct CartPoseErrCalculator : public sco::VectorOfVector |
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.
Have you used rviz_visual_tools to better understand if your vectors are in the right frame, and if the error calculation intuitively makes sense?
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've never seen a struct inheritance... this isn't normal
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 got it from the original trajopt pakage. Should I change them to class?
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 am actually using rviz_visual_tools
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.
yes, per Google style, if it has functions, it should be a class
|
d4013e1 to
71098bd
Compare
There is a lot of infrastructure missing to get this to actually run... - the plugin needs to be registered - pr2_moveit_config is not in moveit_resources
* Clarify object importing * Add suggestion (LARGE_MESH_THRESHOLD) * Add file filter * Add tooltip, clarify names * Fix and clarify names in robot states tab * Add dialogue to Clear button in robot states
Co-authored-by: Henning Kayser <henningkayser@picknik.ai>
…ration (moveit#2185) MoveIt wrapper to Time Optimal Trajectory Generation downsamples trajectory, but its hard coded to keep waypoints with at least 0.001 radians of motion on a joint. For very long and/or dense input trajectories, the downsampled trajectory is still way too large for the iterative optimization algorithm to finish in reasonable time. I was seeing 3000 point trajectory taking ~15 seconds. This fix allows the user to set this downsampling density in minimum radians of motion between two waypoints to something else (presumably higher like 0.5 degrees [0.00875 radians]) in order to drastically improve the speed of this algorithm.
which (mostly) are redundant to the corresponding C++ tests.
- Remove "Import from File" and "Import from URL" buttons, but add those options as item in the shape combobox - Integrate MotionPlanningFrame::addObject() into MotionPlanningFrame::addSceneObject()
- grid layout for object position/orientation spin boxes (to not rely on chance for their column-wise layout anymore) - Limit position spin boxes to -999..999 This essentially cancels one digit to be displayed, which significantly reduces the minimum width of the widget.
clearSceneButtonClicked() -> clearScene() removeObjectButtonClicked() -> removeSceneObject() publishSceneButtonClicked()-> publishScene()
…is not set. Check this and warn the user if ref traj is empty trajectory_test not working yet
Co-Authored-By: Ayush Garg <ayushgargdroid@gmail.com>
Co-Authored-By: Ayush Garg <ayushgargdroid@gmail.com>
Co-Authored-By: Ayush Garg <ayushgargdroid@gmail.com>
osqp_FOUND is false if osqp is pulled in trajopt_sco. osqp can not be found from the same CMakeLists that was used to pull down its repo and install it in build directory. A workaround is to install osqp from trajopt_utils and check if it exists in trajopt_sco. trajopt_sco is dependent on trajopt_utils Another fix: trajopt_problem_ from trajopt_interface needed to be corrected as a shared_pointer.
…jects. Contact type has a depth memeber but in tesseract, they use distance member in their ContactResult type
…calculate cc_nearest_points in MoveIt, Contact type does not have such a thing
…rect. Just used it with FCL and singletimestep not continous collision checking yet.
This version successfully uses Bullet collision detector from MoveIt to do the collsion checking and find singed distances. There are a lot of changes in different files but the most changes are done in collision_terms.cpp Things left to do: 1. This implementation is hard-coded. But it is easy to change this to a version that the user can enter a CollisionTermInfo. Currently this is done in trajopt_interface.cpp but it should be defined by user, its parametes should be added to setup.yaml as well. 2. It needs cleanup in the code base. 3. The PlanningScene that motion planners have acces to is a ConsPtr but we need to make changes in RobotState to be able to check collision. To this end, a child of the original PlanningScene is used through diff() function. For some reason, I can not use "checkCollision" function on this planning scene child. It turned out if I remove all the objects from the child and add them again, "checkCollision" operates correctly

The tesseract env and kin are not used at all. They are replaced with what we have in planning_scene, for that I copied and adjusted the needed files from trajopt_ros, i.e., problem_description and kinematic_terms
The constraint from planning interface request is converted to the constraint we need in trajopt and that is only for joint state constraint for now.
No response from tesseract is used. planning interface response is created and fed internally.
Problems:
There are few struct and classes that are not used
There are headers that are included in different files that might not be used.
Also in CMakeLists, there might be extra or unused packages.
@davetcoleman @BryceStevenWilley @henningkayser @felixvd @j-petit