nicoros - Pyrep¶
The Pyrep class allows control over motors and access to sensors of a NICO simulated in CoppeliaSim through ROS. It combines functions of the Motion and Vision modules.
Before running the node, make sure the required environment variables LD_LIBRARY_PATH and QT_QPA_PLATFORM_PLUGIN_PATH are set properly. To do so run:
source api/pyrep_env.bash
To start the interface with default parameters run:
rosrun nicoros Pyrep.py --vrep-scene=path/to/scene
For a full list of parameters run:
rosrun nicoros Pyrep.py -h
Exposed topics¶
The following ROS topics are exposed by the class - where $PREFIX stands for the prefix of the topics/services (Default: /nico/pyrep), $MOTION is an extension of the prefix for motion related topics (Default: /motion) and $VISION is the same for vision related topics (Default: /vision):
Motion¶
ROS topic name |
Message type |
Short description |
|---|---|---|
$PREFIX/$MOTION/changeAngle |
nicomsg/sff |
|
$PREFIX/$MOTION/closeHand |
nicomsg/s |
|
$PREFIX/$MOTION/disableTorque |
nicomsg/s |
|
$PREFIX/$MOTION/disableTorqueAll |
nicomsg/empty |
Disables torque on all joints. |
$PREFIX/$MOTION/enableTorque |
nicomsg/s |
|
$PREFIX/$MOTION/enableTorqueAll |
nicomsg/empty |
Enables torque on all joints. |
$PREFIX/$MOTION/openHand |
nicomsg/s |
|
$PREFIX/$MOTION/setAngle |
nicomsg/sff |
|
$PREFIX/$MOTION/setMaximumSpeed |
nicomsg/f |
|
$PREFIX/$MOTION/setPID |
nicomsg/sfff |
|
$PREFIX/$MOTION/setStifftness |
nicomsg/sf |
|
Vision¶
ROS topic name |
Message type |
Short description |
|---|---|---|
$PREFIX/$VISION/left |
sensor_msgs/Image |
Video stream of the left vision sensor (one frame per simulation step) |
$PREFIX/$VISION/right |
sensor_msgs/Image |
Video stream of the right visio sensor (one frame per simulation step) |
Exposed services¶
The following ROS services are exposed by the class - where $PREFIX stands for the prefix of the topics/services (Default: /nico/pyrep), $MOTION is an extension of the prefix for motion related topics (Default: /motion) and $VISION is the same for vision related topics (Default: /vision):
Pyrep¶
ROS service name |
Service type |
Short description |
|---|---|---|
$PREFIX/getPose |
nicomsg/GetValues |
Returns the the position of an object in the scene |
$PREFIX/nextSimulationStep |
std_srvs/Empty |
Triggers the next simulation step. |
$PREFIX/startSimulation |
std_srvs/Empty |
Starts the simulation. |
$PREFIX/stopSimulation |
std_srvs/Empty |
Stops the simulation. |
Motion¶
ROS service name |
Service type |
Short description |
|---|---|---|
$PREFIX/$MOTION/getAngle |
nicomsg/GetValue |
Returns the angle of a single joint |
$PREFIX/$MOTION/getAngleLowerLimit |
nicomsg/GetValue |
Returns the lower limit of the angle for a single joint |
$PREFIX/$MOTION/getAngleUpperLimit |
nicomsg/GetValue |
Returns the upper limit of the angle for a single joint |
$PREFIX/$MOTION/getConfig |
nicomsg/GetString |
Returns the JSON configuration of motors |
$PREFIX/$MOTION/getCurrent |
nicomsg/GetValue |
Returns the present currency of a single joint |
$PREFIX/$MOTION/getJointNames |
nicomsg/GetNames |
Returns a list with the names of all joints |
$PREFIX/$MOTION/getPID |
nicomsg/GetPID |
Returns the PID control of a single joint |
$PREFIX/$MOTION/getStifftness |
nicomsg/GetValue |
Returns the stifftness of a single joint |
$PREFIX/$MOTION/getTemperature |
nicomsg/GetValue |
Returns the present temperature of a single joint |
$PREFIX/$MOTION/getTorqueLimit |
nicomsg/GetValue |
Returns the torque limit of a single joint |
$PREFIX/$MOTION/getVrep |
nicomsg/GetString |
Returns if vrep simulation is used or not |