Skip to content

mintasca/ActuatorController_ROS

Repository files navigation

ActuatorController_ROS

A standalone ROS package exclusively for INNFOS actuators A ROS wrapper for INNFOS Actuator Controller

How to Install

ROS

If you have not already, follow the instrutions on http://wiki.ros.org/ to install ROS version of your choice.

Install

This package is tested on an X86 system with Ubuntu 16.04 installed.

Enter your catkin workspace's source directory. You can clone the package with:

$ git clone https://github.com/Rayckey/ActuatorController_ROS.git actuatorcontroller_ros

Then return to the root of your workspace and build the package

$ catkin_make

There's a chance that the package may fail on the first time it is built, if that happens, retry it couple times.

$ source devel/setup.bash

Now you're ready to use the package!

How to Use

ROS node

To run the ros node seperately and start actuators with the default options

$ roscore
$ rosrun actuatorcontroller_ros innfos_actuator

ROS launch

You can launch the node with custom parameters if you wish to change the performance of the controller. These launch files are mere examples and their effects can be combined.

$ roslaunch actuatorcontroller_ros innfos_no_param.launch

This launch file adds the parameter "innfos_no_param" in parameter server. This option will prevent the node from polluting the parameter server when there are too many actuators connected, or prevent other users from altering these parameters.

$ roslaunch actuatorcontroller_ros innfos_fixed_100hz.launch

This launch file adds the parameter "innfos_fixed_rate" in parameter server. When this parameter is present, the node will attempt to process the messages at a fixed rate. This allows for higher control rate or lower cpu usage. Please be informed that the actual control rate will be dependent on the equipment setup.

$ roslaunch actuatorcontroller_ros innfos_use_cvp.launch

This launch file adds the parameter "innfos_use_cvp" in parameter server. When this parameter is true, the controller will use a more efficient method when requesting the current states of the actuators. BUT the values will have a slight delay depending on the control rate. This is best used with the "innfos_fixed_rate" parameter.

ROS Messages, Services & Parameters

Parameters of an INNFOS actuator

The paramters of each actuator are seperated into four groups:
1.Frequently used modifiable parameters
2.Frequently used unmodifiable parameters
3.Infrequently used modifiable parameters
4.Infrequently used unmodifiable parameters
The most accessed parameters can be inquired or modified using ROS messages and services, the less used parameters are only accesable through the ROS Parameter server. The unmodifiable information can only be viewed using ROS services You can easily see the messages/services typies using:

$ rostopic type ${TOPIC_NAME}
$ rosservice type ${SERVICE_NAME}

Published Topics

/INNFOS/actuator_states (sensor_msgs::JointState)

Provide all avaliable actuators' positions, velocities and efforts when the actuators are enabled. Their units are "Rotations", "RPM", and "Amp" respectively.

Subscribed Topics

/INNFOS/enableActuator (ActuatorController_ROS::ActuatorArray)

Enable the designated actuators, if the input is empty or 0, the node will enable all avaliable actuators.

/INNFOS/disableActuator (ActuatorController_ROS::ActuatorArray)

Disable the designated actuators, if the input is empty or 0, the node will disable all avaliable actuators.

/INNFOS/setControlMode (ActuatorController_ROS::ActuatorModes)

Set the control mode for the designated actuators, you can check the avaliable modes by using the service /INNFOS/Dictionary.

/INNFOS/setTargetPosition (ActuatorController_ROS::ActuatorCommand)

Set the target position for the designated actuator, will only have effects when the actuator is in the correct mode.

/INNFOS/setTargetVelocity (ActuatorController_ROS::ActuatorCommand)

Set the target velocity for the designated actuator, will only have effects when the actuator is in the correct mode.

/INNFOS/setTargetCurrent (ActuatorController_ROS::ActuatorCommand)

Set the target current for the designated actuator, will only have effects when the actuator is in the correct mode.

Services

/INNFOS/GeneralQuery service.

(ActuatorController_ROS::GeneralQuery) Function: Allows users to lookup all avaliable actuators and their status. Input: A placeholder variable not needed
Output: Provide a list of all avaliable actuators and their status.

/INNFOS/AttributeQuery (ActuatorController_ROS::AttributeQuery)

Function: Allow users to lookup some frequently used modifiable parameters of the actuators. To modify these parameters, please use the designaed servies/messages
Input: The designated actuator ID.
Output: Return a list of the frequently used parameters for the designated actuator.

/INNFOS/TriviaQuery (ActuatorController_ROS::TriviaQuery)

Function: Allow users to lookup some frequently used unmodifiable parameters of the actuators.
Input: The designated actuator ID.
Output: Return a list of the frequently used unmodifiable parameters for the designated actuator.

/INNFOS/DebugQuery (ActuatorController_ROS::DebugQuery)

Function: Allow users to lookup some infrequently used unmodifiable parameters of the actuators. Th Input: The designated actuator ID.
Output: Return a list of the infrequently used unmodifiable parameters for the designated actuator. Only for debugging.

/INNFOS/Dictionary (ActuatorController_ROS::AttributeDictionary)

Function: Allows user to look up Attribute terms' meanings and usages. Input: The attribute term (i.e. "MODE_ID") in string
Output: The explaination and usage of the term or parameter.

/INNFOS/IDChange (ActuatorController_ROS::IDModify)

Function: Permentaly download the user's setting into the actuator, allows it to take effect the next time it is powered up.
Input: The original ID, and the modified ID.
Output: Will return a boolean to indicate whether this operation is successful.

/INNFOS/ParametersSave (ActuatorController_ROS::ParametersSave)

Function: Permentaly download the user's setting into the actuator, allows it to take effect the next time it is powered up.
Input: The designated actuator ID.
Output: Will return a boolean to indicate whether this operation is successful.

/INNFOS/ZeroReset (ActuatorController_ROS::ZeroReset)

Function: Reset the actuator's abosulte zero position to its current position, the actuator has to be in homeing mode for it to take effects. (Due to some issues, the actuator may appear to be in current mode even after setting it to homing mode, but it will still have taken effects.)
Input: The designated actuator ID.
Output: Allows the user to reset the zero position of the actuator. Note that any changes will need to be saved using the /INNFOS/ParametersSave for it to take effects in the next boot-up.

Parameters Server

This allows the user to modifiy the infrequently used modifiable parameters.
Since each actuator has a number of modifiable parameters, the parameter names on the server are arraged in the format of :

/INNFOS/Actuator/${ACTUATOR_ID}/${PARAMETER_NAME}

You can look up the parameter using the service /INNFOS/Dictionary.
ote that any changes will need to be saved using the /INNFOS/ParametersSave for it to take effects in the next boot-up.
If the assignment was unsuccessful, the parameter will be reverted on the server.

Usage Example

For a first time user, it is recommanded to read through the INNFOS wiki page for the setup: https://innfos.github.io/wiki/en
You can start the ROS node as soon as the device is connected to the commnunication bridge.
To ensure all the actuators are connected, you should first check the lists of avaliable actuators via the /INNFOS/GeneralQuery service:

rosservice call /INNFOS/GeneralQuery "isQuery: true" 

And then, you can enable the actuators of your choice. Here we try to enable all the actuators in one go by using the ID 0:

rostopic pub -1 /INNFOS/enableActuator actuatorcontroller_ros/ActuatorArray "JointIDs:
- 0" 

It should be noted that there should not be any actuators with the ID 0.
By default, the actuators when first launched will be in current mode, you can varify it using the service:

rosservice call /INNFOS/AttributeQuery "ActuatorID: 1"

The "MODE_ID" variable is the active mode of the actuator.
If you come across a term that you need more clarifications of, you can call the service:

rosservice call /INNFOS/Dictionary "LookupTerm:
  data: 'MODE_ID'" 

You will get a detailed explanation for this parameter.

To enforce position control to the robot, you should first change its mode:

rostopic pub -1 /INNFOS/setControlMode actuatorcontroller_ros/ActuatorModes "JointIDs:
- 3
ActuatorMode: 4" 

Here we changed the third actuator to Mode_Profile_Pos, which allows us to control the actuator's position with local planner.

rostopic pub -1 /INNFOS/setTargetPosition actuatorcontroller_ros/ActuatorCommand "JointID: 0
TargetValue: 0.0"

And the target position commands can finally take effect.

Change logs

Added a usage example: 2019/08/21

About

ROS Wrapper for INNFOS Actuators

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 93.1%
  • Python 2.7%
  • CMake 2.3%
  • C 1.9%