GithubHelp home page GithubHelp logo

usb_relay_wsn's Introduction

usb_relay_wsn

A ROS node to control the states of relays

Setup

Follow the Getting Started guide of the usb_relay module, as well as the next step, Changing the name of a module.

Usage

To start the node from the command line, run rosrun usb_relay_wsn ros_relay_bridge.py. This will listen for service calls for each relay, using each relay's name as the topic. If multiple relays have the same name, they will be controlled together.

It is recommended to namespace this node. To do this from the command line, run ROS_NAMESPACE=relays rosrun usb_relay_wsn ros_relay_bridge.py. This will prefix each relay with relays, so a relay with a name of serno will be controlled from /relays/serno.

This node will listen for service calls using the SetRelay service type. It will publish relay states with the RelayStates message type. Both the service and topic use the name of the relay. To change the name of a relay, follow the instructions to change the name of a module.

The following examples are shown without a namespace:

rostopic from the command line

# Shows the state of the relays with a name of 'serno'
rostopic echo /serno

rosservice from the command line

Used to change the state of relays.

# Turning relay 1 on with a name of 'serno'
rosservice call /serno '[{id: 1, state: true}]'
# Turning all relays on with a name of 'serno'
rosservice call /serno '[{id: 0, state: true}]'
# Turning relay 1 on and relay 2 off with a name of 'serno'
rosservice call /serno '[{id: 1, state: true}, {id: 2, state: false}]'

usb_relay_wsn's People

Contributors

lights0123 avatar wsnewman avatar

Watchers

James Cloos avatar  avatar

Forkers

lights0123

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.