[Documentation] [TitleIndex] [WordIndex

Only released in EOL distros:  

Package Summary

ROS Package for the Element microcontroller made by cmRobot.

Package Summary

ROS Package for the Element microcontroller made by cmRobot.

Package Summary

ROS Package for the Element microcontroller made by cmRobot.

Overview

The Element package consists of a Python driver and ROS node for the Element microcontroller made by cmRobot. The Element connects to a PC or SBC using either a USB port, XBEE radios or TTL.

float

Features

Element Node

element-node.py

A ROS node for the Element microcontroller made by cmRobot. Uses a multi-threaded queue so that each sensor can be polled at its own rate (see sample config file at the end of this page.) For example, main voltage could be polled at 1 Hz while a sonar sensor could be polled at 10 Hz.

Subscribed Topics

/cmd_vel (geometry_msgs/Twist)

Published Topics

/odom (nav_msgs/Odometry) ~sensors (element/SensorState) ~sensor/sensor_name (sensor_msgs/Range,)

Services

~SetServo (element/SetServo) ~GetAnalog (element/GetAnalog) ~Voltage (element/Voltage) ~Ping (element/Ping) ~GP2D12 (element/GP2D12) ~PhidgetsTemperature (element/PhidgetsTemperature) ~PhidgetsVoltage (element/PhidgetsVoltage) ~PhidgetsCurrent (element/PhidgetsCurrent) ~Rotate (element/Rotate) ~TravelDistance (element/TravelDistance) ~Speak (element/SP03)

Parameters

~port (str, default: /dev/ttyUSB0) ~baud (int, default: 19200) ~timeout (float, default: 0.5) ~publish_sensors (bool, default: False) ~sensor_rate (int, default: 10) ~use_base_controller (bool, default: False) ~units (int, default: 0) ~wheel_diameter (float, default: none) ~wheel_track (float, default: none) ~encoder_type (int, default: 1) ~encoder_resolution (int, default: none) ~gear_reduction (float, default: 1.0) ~motors_reversed (bool, default: False) ~init_pid (bool, default: False) ~VPID_P (int, default: none) ~VPID_I (int, default: none) ~VPID_D (int, default: none) ~VPID_L (int, default: none) ~DPID_P (int, default: none) ~DPID_I (int, default: none) ~DPID_D (int, default: none) ~DPID_L (int, default: none) ~base_controller_rate (int, default: 10) ~analog (dict, default: None) ~digital (dict, default: None) ~maxez1 (dict, default: None)

Provided tf Transforms

odombase_link

Configuration

The Element node is configured using a YAML file specifying the required parameters. A sample parameter file called element_params.yaml is included in the distribution in the config directory and is shown below. Note that many of the parameters are commented out and must be set and un-commented before you can use the node with your Element.

Current valid sensor types names (case-sensitive):

port: /dev/ttyUSB0
baud: 19200
timeout: 1
sensor_rate: 10
#use_base_controller: True
#base_controller_rate: 10
#wheel_diameter: <fill in and uncomment for your robot>
#wheel_track: <fill in and uncomment for your robot>
#encoder_type: 1
#encoder_resolution: <fill in and uncomment for your robot>
#gear_reduction: <fill in and uncomment for your robot>
#motors_reversed: False
#init_pid: True
#units: 0
#VPID_P: <fill in and uncomment for your robot>
#VPID_I: <fill in and uncomment for your robot>
#VPID_D: <fill in and uncomment for your robot>
#VPID_L: <fill in and uncomment for your robot>
#DPID_P: <fill in and uncomment for your robot>
#DPID_I: <fill in and uncomment for your robot>
#DPID_D: <fill in and uncomment for your robot>
#DPID_A: <fill in and uncomment for your robot>
#DPID_B: <fill in and uncomment for your robot>

publish_sensors: True

# Examples only - change accordingly for your robot.
analog: { voltage: {pin: 5, type: Voltage, rate: 1}, drive_current: {pin: 1, type: PhidgetsCurrent, rate: 1}, light_sensor: {pin: 2, type: Analog, rate: 10} }
#digital: { base_sonar: {pin: 5, type: Ping, rate: 1} }

Example Launch File

<launch>
   <node name="element" pkg="element" type="element_node.py" output="screen">
   <rosparam file="$(find my_robot)/config/element_params.yaml" command="load" />
   </node>
</launch>

Usage Notes


2019-10-12 12:35