Skip to content

Conversation

@ommmid
Copy link
Owner

@ommmid ommmid commented Jul 23, 2019

  • 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:

  • The start state for trajopt is not set, that is probably why I get a solution that has the same joint values for all timesteps except the last timestep
  • start_fixed is set to false. if it is true it means: it constraints the joint values to be their initialized ones but because the start state is not set, then it creates problem. I am not sure about this.
  • Please ignore the followings:
    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

Copy link

@BryceStevenWilley BryceStevenWilley left a 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.

CartPoseErrCalculator(const Eigen::Isometry3d& pose,
const planning_scene::PlanningSceneConstPtr planning_scene,
std::string link,
Eigen::Isometry3d tcp = Eigen::Isometry3d::Identity())

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.

Copy link
Owner Author

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 ^_^";

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();

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.

Copy link
Owner Author

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.

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.

Copy link
Owner Author

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.

@davetcoleman
Copy link

start_fixed is set to false. if it is true it means: it constraints the joint values to be their initialized ones but because the start state is not set, then it creates problem. I am not sure about this.

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

Copy link

@davetcoleman davetcoleman left a 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:

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

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

Copy link
Owner Author

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?

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

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?

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

Copy link
Owner Author

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?

Copy link
Owner Author

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

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

@ommmid
Copy link
Owner Author

ommmid commented Jul 23, 2019

start_fixed is set to false. if it is true it means: it constraints the joint values to be their initialized ones but because the start state is not set, then it creates problem. I am not sure about this.

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

#1 (comment)

@ommmid
Copy link
Owner Author

ommmid commented Jul 23, 2019

Can you share relevant diagrams explaining the relationship of the files / classes in this PR?

trajoptflow

@ommmid ommmid changed the title Somewhat working Trajopt Working Trajopt Jul 31, 2019
@ommmid ommmid force-pushed the trajopt branch 4 times, most recently from d4013e1 to 71098bd Compare August 16, 2019 17:08
v4hn and others added 15 commits July 2, 2020 13:29
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()
omid and others added 29 commits February 13, 2021 10:42
…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
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.