ros / ros_tutorials

Code used in tutorials found on ROS wiki
http://wiki.ros.org/ros_tutorials
805 stars 540 forks source link

Add RotateAbsolute action to turtlesim #62

Closed jacobperron closed 5 years ago

jacobperron commented 5 years ago

Resolves #61

dirk-thomas commented 5 years ago

In order to trigger this action easily it would be good to update keyboard teleop with a few key to rotate to e.g. orientations in 90 (e.g. R|G|V|D) / 45 (e.g. R|T|G|B|V|C|D|E) degrees steps.

jacobperron commented 5 years ago

In order to trigger this action easily it would be good to update keyboard teleop with a few key to rotate to e.g. orientations in 90 (e.g. R|G|V|D) / 45 (e.g. R|T|G|B|V|C|D|E) degrees steps.

I was just about to post some commands for testing this. Since this is intended to go along with the tutorial, I figured the user will be prompted to send the actions with ros2 action tool. For example:

ros2 action send_goal /turtle1/rotate_absolute turtlesim/action/RotateAbsolute "theta: 1.57"

another with feedback:

ros2 action send_goal /turtle1/rotate_absolute turtlesim/action/RotateAbsolute "theta: 1.0" --feedback

Adding to the keyboard teleop isn't a bad idea either. Want me to follow up in a second PR?

dirk-thomas commented 5 years ago

Want me to follow up in a second PR?

Either a separate one or added to this. I don't mind either way.

jacobperron commented 5 years ago

@dirk-thomas See 0e6dec2 for keyboard teleop support. I also made the 'F' key cancel an action.

dirk-thomas commented 5 years ago

With this patch when quiting the teleop node the console is "unusable" since the state isn't correctly restored anymore. E.g. you don't see what you type. Since that is not the case on the target branch it seems to be related to the changes.

jacobperron commented 5 years ago

With this patch when quiting the teleop node the console is "unusable" since the state isn't correctly restored anymore. E.g. you don't see what you type. Since that is not the case on the target branch it seems to be related to the changes.

Odd. It doesn't happen for me in ZSH, but I can reproduce the issue with Bash...

jacobperron commented 5 years ago

@dirk-thomas c31fab3 seems to resolve the shell issue after shutdown.

dirk-thomas commented 5 years ago

Thanks for the new functionality. Looks good to me :+1: