ROS2 service definitions for reference signal generation
ROS version | Branch |
---|---|
ROS2 | ros2 |
ROS1 | ros1 |
This repo contains the service definitions for reference signal generations, required by the reference_signal_generator package.
This repo is a ROS2 package (ament_cmake) dedicated to service interface definitions. Learn more about ROS2 services in the ROS2 documentation.
- A ROS2 workspace (colcon)
- See this tutorial to learn how to create your own workspace.
As mentioned above, this repo is a standard ROS2 package. Thus, you simply have to clone it inside your workspace's src directory, making sure to use the ros2 branch.
cd <path_to_your_ros2_ws>/src
git clone -b ros2 https://github.com/leggedrobotics-usp/reference_signal_srvs.git
Then, use colcon to build.
cd <path_to_your_ros2_ws>
colcon build --symlink-install
Service message definitions (.srv files) are not directly usable by themselves. The reference_signal_generator package uses this repo's definitions to spawn services that trigger actual signal generation in a chosen ROS2 topic.
You can also use the definitions of this repository to build other packages related to control signal generation.
The goal of this service is to trigger a reference signal with an arbitrary number of inputs (or DOFs). Thus, most arguments are array-type. They must all have the same length.
string[] signal_type
String array describing the desired signal type for each input. Supported values are"step", "ramp", "sine", "square", "triangle", "sawtooth", "chirp"
.float64[] initial_value
Numeric array describing the initial value for each input. Applies to Step and Ramp signals.float64[] final_value
Numeric array describing the final value for each input. Applies to Step signals.float64[] start_time
Numeric array describing the time (seconds) at which each input will be started. Applies to all signals.float64[] end_time
Numeric array describing the time (seconds) at which each input will stop. Applies to all signals. Supportsinf
for continuous publishing.float64[] slope
Numeric array describing the slope for each input. Applies to Ramp signals.float64[] offset
Numeric array describing the DC offset for each input. Applies to Sine, Square, Triangle, Sawtooth and Chirp signals.float64[] amplitude
Numeric array describing the total amplitude for each input. Applies to Sine, Square, Triangle, Sawtooth and Chirp signals.float64[] frequency
Numeric array describing the waveform frequency (Hz) for each input. Applies to Sine, Square, Triangle and Sawtooth signals.float64[] phase
Numeric array describing the phase shift (degrees) for each input. Applies to Sine, Square, Triangle, Sawtooth and Chirp signals.float64[] initial_frequency
Numeric array describing the frequency (Hz) att = start_time
for each input. Applies to Chirp signals.float64[] target_frequency
Numeric array describing the frequency (Hz) att = target_time
for each input. Applies to Chirp signals.float64[] target_time
Numeric array describing the time (seconds) at which the chirp frequency will linearly reachtarget_frequency
for each input. Applies to Chirp Signals.float64 publish_rate
Number describing the rate (Hz) at which the topic will publish the reference signal.float64 total_time
Number describing the total duration (seconds) of all reference signals. Supportsinf
for continuous publishing.
Please note that, although some inputs are specific for a certain type of signal, all arrays must be supplied with the same length during the service call, filling the unused fields with any arbitrary value.
success
Boolean output to indicate whether or not the reference signal was successfully published.message
String to give more detailed information about the service call.
Want another type of reference signal that demands an additional argument or a different type of service definition? Open an Enhancement issue describing it.
- Fork the repo
- Check out a new branch based and name it to what you intend to do:
-
git checkout -b BRANCH_NAME
-
- Commit your changes
- Please provide a git message that explains what you've done;
- Commit to the forked repository.
git commit -m "A short and relevant message"
- Push to the branch
-
git push origin BRANCH_NAME
-
- Make a pull request!
Victor T. N. 🤖
Made with ❤️ by @Vtn21