Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Besides writing a custom node, I can come up with two options:

  1. treat your spacenav as a joystick, and use something like teleop_tools/joy_teleop. That node supports scaling and a few other options which seem to do what you describe
  2. keep using raw values from your spacenav, but scale them using topic_tools/transform. That node subscribes to a topic, runs it through a Python expression and then publishes the result to (preferably) a new topic

I've used both in the past.

Try to avoid writing code yourself as much as possible.

Besides writing a custom node, I can come up with two options:

  1. treat your spacenav as a joystick, and use something like teleop_tools/joy_teleop. That node supports scaling and a few other options which seem to do what you describe
  2. keep using raw values from your spacenav, but scale them using topic_tools/transform. That node subscribes to a topic, runs it through a Python expression and then publishes the result to (preferably) a new topic

I've used both in the past.

Try to avoid writing code yourself as much as possible.

A previous Q&A about transform is #q261935, which shows how to format complex expressions.

Besides writing a custom node, I can come up with two options:

  1. treat your spacenav as a joystick, and use something like teleop_tools/joy_teleop. That node supports scaling and a few other options which seem to do what you describe
  2. keep using raw values from your spacenav, but scale them using topic_tools/transform. That node subscribes to a topic, runs it through a Python expression and then publishes the result to (preferably) a new topic

I've used both in the past.

Try to avoid writing code yourself as much as possible.

A previous Q&A about transform is #q261935, which shows how to format complex expressions.

And something to realise: any additional nodes (or really: publishers and subscribers) you place between your input device and the final consumer of your Twists is going to add delay and jitter. That may not be a problem in your case, but it is something to keep in mind when working with such a system.

Besides writing a custom node, I can come up with two options:

  1. treat your spacenav as a joystick, and use something like teleop_tools/joy_teleop. That node supports scaling and a few other options which seem to do what you describe
  2. keep using raw values from your spacenav, but scale them using topic_tools/transform. That node subscribes to a topic, runs it through a Python expression and then publishes the result to (preferably) a new topic

I've used both in the past.

Try to avoid writing code yourself as much as possible.

topic. A previous Q&A about transform is #q261935, which shows how to format complex expressions.expressions

I've used both in the past.

Try to avoid writing code yourself as much as possible.

And something to realise: any additional nodes (or really: publishers and subscribers) you place between your input device and the final consumer of your Twists is going to add delay and jitter. That may not be a problem in your case, but it is something to keep in mind when working with such a system.

Besides writing a custom node, I can come up with two options:

  1. treat your spacenav as a joystick, and use something like teleop_tools/joy_teleop. That node supports scaling and a few other options which seem to do what you describe
  2. keep using raw values from your spacenav, but scale them using topic_tools/transform. That node subscribes to a topic, runs it through a Python expression and then publishes the result to (preferably) a new topic. A previous Q&A about transform is #q261935, which shows how to format complex expressions

I've used both in the past.

Try Option 1 will probably be the easiest to implement. Option 2 is the most flexible, as it's almost a custom node, but then as an argument to the topic_tools/transform node.

In any case: try to avoid writing code yourself as much as possible.

And something to realise: any additional nodes (or really: publishers and subscribers) you place between your input device and the final consumer of your Twists is going to add delay and jitter. That may not be a problem in your case, but it is something to keep in mind when working with such a system.