-
Notifications
You must be signed in to change notification settings - Fork 37
Moveit Doesn't Work From C++ without a restart #31
Comments
I found the logs. Here is the relevant excerpt from my "bad" requests. These start working as soon as I start moveit myself. All is well! Everyone is happy! You can start planning now! [ INFO] [1525042152.149556442]: Combined planning and execution request received for MoveGroup action. Forwarding to planning and execution pipeline. |
I figured out that this has to do with different clocks between my base station and movo. What is the correct way to sync time? If I just run ntpdate on movo1 and movo2, is that sufficient? |
I am not 100% sure it is relevant in your case, but you can look at this script to use chrony for time synchronization |
I am asking how it works on the movo platform. As of now, our movo is several hours behind "real" time. If I just plug it in and run ntpdate on movo1 and movo2, is that sufficient? Is there any time synchronization required for the arms for example? |
Hi @stefie10 I believe you are more knowledgeable than I am here :-O. What I can tell you is the arms do not need any time synchronization. You only have to consider the movo1 and movo2 computers for time synchronization on the movo. Have you tested ntpdate yet? From what I see online, it seems to do what you want to do. I've never used this function command. I can ask around tomorrow in case some colleagues would have some extra insight. Thanks and sorry I cannot answer your question completely. |
We will give it a shot and let you know. |
Hi @stefie10 Yesterday, I had a another look at the log you posted and I saw this Maybe your C++ initialization script and the python initialization script are conflicting? The python initialization script is called at boot up. Have you modified movo_moveit.launch to run your C++ initialization script instead? How did you figured out it was a sync time problem?¸What made you think this was the cause of your issue? Thank you |
Hi @stefie10 Can I close this issue? |
I am trying to send moveit commands from C++. I was working from the Python initialization code (to move to home and move to tuck) and basically did a C++ version of that with the MoveGroup class, but the arm would not move.
To try to debug it, I looked for the moveit log files on movo2, but they weren't in any obvious places. Where are they?
After failing to find the log file, I decided to try starting moveit myself so I could see what happened when I was sending the C++ service calls and if there were any errors in the log. I ran the following command:
roslaunch movo_7dof_moveit_config movo_moveit_planning_execution.launch debug:=true
Which I believe kills the moveit process that is started during bootup, then restarts it. Everything starts fine, it says "All is well! Everyone is happy! You can start planning now!", and my C++ code starts magically working. Something is clearly different between when moveit starts from boot, and when I launch it.
Here is my extracted code, which works just fine when I launch moveit myself from movo2, but does not work after a clean boot. And note that the boot itself successfully moves the arms to home, then tuck, using the Python init script.
upperBody = new MoveGroup("upper_body");
upperBody->setPlannerId("RRTConnectkConfigDefault");
for (int i = 0; i < MC->homedJoints.size(); i++) {
bool result = MC->upperBody->setJointValueTarget(MC->upperBodyJoints[i], MC->homedJoints[i]);
if (!result) {
CONSOLE_ERROR(ms, "Invalid joint target: " << MC->upperBodyJoints[i] << " value: " << MC->homedJoints[i]);
return;
}
}
MoveItErrorCode r = MC->upperBody->asyncMove();
if (r.val != moveit_msgs::MoveItErrorCodes::SUCCESS) {
CONSOLE_ERROR(ms, "Couldn't execute. Code: " << r.val);
}
The text was updated successfully, but these errors were encountered: