Skip to content
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

[WIP] [hrpsys_ros_bridge] Start joint trajectory at assigned timing #1052

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

pazeshun
Copy link
Collaborator

Depends on #1049
Fixes #1048

@pazeshun
Copy link
Collaborator Author

Execution flow:

  1. Check time stamp of joint trajectory in its callback
  2. When time stamp is in future, just remember time stamp and trajectory in member variables without executing trajectory. Otherwise, just execute onJointTrajectory function as before
  3. Check whether remembered time stamp is in present or past in execution loop (onExecute)
  4. When remembered time stamp is in present or past, execute trajectory by calling onJointTrajectory from execution loop

@pazeshun pazeshun force-pushed the fix-feedback-and-start-time-of-traj branch from 905ce18 to 3d7c61e Compare July 12, 2018 15:32
@pazeshun pazeshun changed the title [hrpsys_ros_bridge] Execute joint trajectory at assigned timing [hrpsys_ros_bridge] Start joint trajectory at assigned timing Jul 12, 2018
@pazeshun
Copy link
Collaborator Author

Currently, feedback from joint trajectory starts directly after getting goal, and stops when trajectory is completed.
time_from_start of feedback (e.g. /fullbody_controller/follow_joint_trajectory_action/feedback/feedback/error/time_from_start) is calculated based on trajectory start time.
So when trajectory is in future, time_from_start starts from minus value.

@pazeshun
Copy link
Collaborator Author

pazeshun commented Jul 13, 2018

I want to follow common specification of feedback, but specification is not uniformed...

* In all cases, joint trajectory is started on its time stamp, which is implemented in this PR.

@pazeshun
Copy link
Collaborator Author

pazeshun commented Jul 14, 2018

NOTE: After this PR, time synchronization between PC bringing up ros bridge and PC publishing trajectory goal becomes very important.

@pazeshun pazeshun requested a review from mmurooka July 24, 2018 06:40
@mmurooka
Copy link
Member

NOTE: After this PR, time synchronization between PC bringing up ros bridge and PC publishing trajectory goal becomes very important.

これってノートPCから毎日違うロボットを動かそうとするときに,ロボットごとに時計が違ったら困りそうですが,その場合の正しい対処は何でしょうか.

@pazeshun
Copy link
Collaborator Author

これってノートPCから毎日違うロボットを動かそうとするときに,ロボットごとに時計が違ったら困りそうですが,その場合の正しい対処は何でしょうか.

違うロボットを使う場合は、そのロボットの時計に合わせるのがROSのルールになっています。
https://answers.ros.org/question/11570/ros-time-across-machines/
ntp/chronyのサーバをrosmasterと同じにすることで対応できます。
なので厳密には、ロボットを変えるたびにPCの設定を書き換えることになります。

@mmurooka
Copy link
Member

なるほど,ちょっと面倒そうだけれど,”ROSのルール”と言われたら仕方ないのか.

@furushchev
Copy link
Member

横から失礼します.
参考までに,PR2ではchronyを使って,nictの時計に合わせたPCを1つ用意して,そのPCに対して各ロボットやラップトップなどをすべて合わせるようにしています.
(ラップトップはロボットに合わせている場合もあり)

@pazeshun
Copy link
Collaborator Author

なるほど,ちょっと面倒そうだけれど,”ROSのルール”と言われたら仕方ないのか.

ただ、実際はあまり時間ずれしてなくて、そのまま使えちゃうことの方が多いようにも思います。
現在、時刻が大きくずれていても:angle-vectorが実行できてしまうのは、hrpsys_ros_bridgeを使っているロボットだけかと思います。

参考までに,PR2ではchronyを使って,nictの時計に合わせたPCを1つ用意して,そのPCに対して各ロボットやラップトップなどをすべて合わせるようにしています.
(ラップトップはロボットに合わせている場合もあり)

今までちゃんと考えたことなかったですが、JSKのロボットを全て一つのPCに合わせるようにすれば、そのPCにラップトップを合わせるようにすればよいだけになるので、楽になってよさそうですね。

@YoheiKakiuchi
Copy link
Member

http://wiki.ros.org/joint_trajectory_controller では、 stamp に 0 を入れると、受け取り次第動き出すようになっている。
これは、これまでのRosBridgeの動作と同じ動作をする。
時間同期が必要なかったら 0 を入れるという運用もありかもしれない。

@pazeshun
Copy link
Collaborator Author

pazeshun commented Oct 29, 2019

I found that current implementation doesn't support multiple trajectory waiting.
When new trajectory comes, waiting trajectory should be cancelled, so current implementation may be correct.
However, I didn't come up with that situation and didn't test.
Back to WIP.

@pazeshun pazeshun changed the title [hrpsys_ros_bridge] Start joint trajectory at assigned timing [WIP] [hrpsys_ros_bridge] Start joint trajectory at assigned timing Oct 29, 2019
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.

Joint trajectory is executed immediately even if its time stamp is in future
4 participants