Skip to content

ROS1 + ROS2 service definitions for reference signal generation

License

Notifications You must be signed in to change notification settings

leggedrobotics-usp/reference_signal_srvs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

reference_signal_srvs

GitHub issues GitHub pull requests GitHub forks GitHub stars GitHub license


ROS2 service definitions for reference signal generation

ROS version Branch
ROS2 ros2
ROS1 ros1

📝 Table of Contents

🧐 About

This repo contains the service definitions for reference signal generations, required by the reference_signal_generator package.

🏁 Getting Started

This repo is a ROS2 package (ament_cmake) dedicated to service interface definitions. Learn more about ROS2 services in the ROS2 documentation.

🛠 Prerequisites

  • A ROS2 workspace (colcon)

💻 Installing

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

🎈 Usage

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.

Request arguments

  • 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. Supports inf 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) at t = start_time for each input. Applies to Chirp signals.
  • float64[] target_frequency Numeric array describing the frequency (Hz) at t = 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 reach target_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. Supports inf 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.

Response arguments

  • 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.

🔋 Feature requests

Want another type of reference signal that demands an additional argument or a different type of service definition? Open an Enhancement issue describing it.

🤝 Contributing

  • 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!

✍️ Author


Victor T. N. 🤖

Made with ❤️ by @Vtn21

About

ROS1 + ROS2 service definitions for reference signal generation

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages