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

Add speed&turn parameters #34

Open
wants to merge 3 commits into
base: dashing
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,7 @@ CTRL-C to quit
- If false (the default), publish a `geometry_msgs/msg/Twist` message. If true, publish a `geometry_msgs/msg/TwistStamped` message.
- `frame_id (string, default: '')`
- When `stamped` is true, the frame_id to use when publishing the `geometry_msgs/msg/TwistStamped` message.
- `speed (dobule, default: 0.5)`
- The speed the node starts with by default.
- `turn (dobule, default: 1.0)`
- The rurn rate (rad/s) the node starts with by default.
5 changes: 3 additions & 2 deletions teleop_twist_keyboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ def main():
# parameters
stamped = node.declare_parameter('stamped', False).value
frame_id = node.declare_parameter('frame_id', '').value
speed = node.declare_parameter('speed', 0.5).value
turn = node.declare_parameter('turn', 1.0).value

if not stamped and frame_id:
raise Exception("'frame_id' can only be set when 'stamped' is True")

Expand All @@ -153,8 +156,6 @@ def main():
spinner = threading.Thread(target=rclpy.spin, args=(node,))
spinner.start()

speed = 0.5
turn = 1.0
x = 0.0
y = 0.0
z = 0.0
Expand Down