ROS in ANVEL

From ANVEL Wiki
Jump to: navigation, search
Noun 336.png | Experimental: ROS support is an experimental feature in ANVEL 3.5.

ROS-integrated Plugins

ANVEL 3.5 release includes Robot Operating System (ROS)-integrated ANVEL plugins. ROS is an open-source, meta-operating system for developing robots. The ROS plugins provide ANVEL the ability to initialize its own ROS node, start a ROS core, connect to a ROS core on a local or external machine, as well as create a number of new sensors which send and receive data using ROS topics. In order to use the ROS features, ANVEL must be installed on an Ubuntu 14.04 system alongside an installation of the ros-indigo-desktop-full and ros-indigo-navigation packages. These features have been used to work with the ROS 2D navigation package and other packages.

ROS Guides and Tutorials

For users new to ROS, see links below to become familiarized with the concepts.

ROS in ANVEL Examples

Examples include:

Using ROS in ANVEL

In ANVEL 3.5, find the AnvelRosInit.xml document in the ANVEL/bin/common directory alongside the AnvelInit.xml file. The parameters contained in the AnvelRosInit.xml file outline ROS behaviors that the ANVEL node needs to set or be aware of. This includes the location of the ROS core if using ANVEL on a separate machine and whether ANVEL should attempt to create a node. These parameters are outlined below:

Attribute Type Default Value Description
useRos Boolean True If this parameter is true, the ANVEL node manager attempts to initialize a ROS node. If it is false, no nodes initialize and ANVEL/ROS plugins are unavailable.
startRosCore Boolean True If this parameter is true, the ANVEL node manager attempts to start a ROS core in a separate terminal from ANVEL. If this parameter is false, the ANVEL node manager attempts to connect to a pre-existing ROS core.
useRosNetwork Boolean False If this parameter is true, the ANVEL node manager attempts to connect to a ROS core on a separate machine using the values set in the “masterURI” and “ip” parameters. If this parameter is false, the ANVEL node manager attempts to connect to a local ROS core (including the one started by ANVEL, if the “startRosCore” parameter is true).
masterURI String empty The IP address and specified port number of the ROS core that will be connected to if the useRosNetwork parameter is set to true (see ROS Network Setup)
ip String empty The IP address of the ANVEL machine; used if the useRosNetwork parameter is set to true
useSimTime Boolean False If this parameter is true, any ros::time functions use values published by the rosgraph_msgs/Clock topic (see ROS Network Setup).

ROS Sensors and Controllers

Once the behavior of ANVEL’s ROS node has been properly defined in the AnvelRosInit.xml file, the ROS-integrated sensors and controllers can be used in the same way as ANVEL assets.

Component Usage
ROS Camera
ROS Controller
ROS Twist Controller
ROS GPS
ROS Lidar
ROS IMU
ROS Nav

ROS/ANVEL Sensor Parameters

DefaultSensorDefinitions.xml

Below are the parameters used to define each sensor in the DefaultSensorDefinitions.xml file.

ROS CAMERA

Camera Parameters

Attribute Type Default value Description Required?
name string “ROS Camera” Name of this sensor instance yes
sensorType string “Ros_ Camera” Name of the sensor type yes
sampleRate double “10.0” Sample frequency in Hz yes
preview string “CameraBig.png” Preview Icon to use in the Assets tab no
objectAsset string “CameraObject” Name of the object asset to use for representing this sensor in the simulation yes
tags string “ANVEL_Common” Designates to the ANVEL asset system that this is a commonly used object no
cameraTopicName string “Anvel_Camera_Data” Name of the sensor_msgs::Image topic no
cameraQueueSize uint32 “1” Size of the sensor_msgs::Image topic queue no

Lens Parameters

Attribute Type Default value Description Required?
resolutionX integer “320” Width of image in pixels yes
resolutionY integer “240” Height of image in pixels yes
ccdWidth double “4.8” Horizontal size of the receptor sensor in mm no
ccdHeight double “3.6” Vertical size of the receptor sensor in mm no
focalLength double “2.5” Focal Length in mm no
hFOV double “0” Horizontal field of view angle (degrees) no
vFOV double “0” Vertical field of view angle (degrees) no
enabled bool true If this lens is currently enabled no
effects string “” Rendering effects to apply to the lens no
position tag x="0.13" y="0.0" z="0" Offset of the lens position relative to the sensor no
orientation tag w="1.0" x="0.0" y="0.0" z="0.0" Rotation offset from the parent sensor no

ROS GPS

Attribute Type Default value Description Required?
name string “ROS GPS” Name of this sensor instance yes
sensorType string “Ros_GPS” Name of the sensor type yes
sampleRate double “1.0” Sample frequency in Hz yes
preview string “GenericSensorIcon.png” Preview icon to use in the Assets tab no
objectAsset string “GenericSensor” Name of the object asset to use for representing this sensor in the simulation yes
tags string “ANVEL_Common” Designates to the ANVEL asset system that this is a commonly used object no
gpsTopicName string "Anvel_GPS_Data" Name of the sensor_msgs::NavSatFix topic no
gpsQueueSize uint32 “1” Size of the sensor_msgs:: NavSatFix topic queue no

ROS IMU

Attribute Type Default value Description Required?
name string “ROS Imu” Name of this sensor instance yes
sensorType string “Ros_ Imu” Name of the sensor type yes
sampleRate double “100.0” Sample frequency in Hz yes
preview string “SmartIMU300.png” Preview icon to use in the Assets tab no
objectAsset string “GenericSensor” Name of the object asset to use for representing this sensor in the simulation yes
tags string “ANVEL_Common” Designates to the ANVEL asset system that this is a commonly used object no
positionCoordinateSystem bool “true” If false, the sensor will return position readings in WGS84 (deg, deg, m). Otherwise it will return position readings in ANVEL's world coordinate frame (m, m, m). no
velocityInWorldFrame bool “true” If false, the sensor will return velocity in the sensor's local coordinate frame. no
accelerationInworldFrame bool “true” If false, the sensor will return acceleration in the sensor's local coordinate frame. no
reportGravity bool “false” If true, the sensor will factor gravity into the acceleration readings. no
attitudeRateInWorldFrame bool “true” If false, the sensor will return attitude rate in the sensor's local coordinate frame. no
imuTopicName string "Anvel_IMU_Data" Name of the sensor_msgs::Imu topic no
imuQueueSize uint32 “1” Size of the sensor_msgs::Imu topic queue no
speedTopicName string "Anvel_Speed_Data" Name of the std_msgs::Float64 topic no
speedQueueSize uint32 “1” Size of the std_msgs::Float64 topic queue no
positionTopicName string "Anvel_Position_Data" Name of the geometry_msgs::Vector3 topic no
positionQueueSize uint32 “1” Size of the geometry_msgs::Vector3 topic queue no

ROS NAV

Attribute Type Default value Description Required?
name string “ROS Nav” Name of this sensor instance yes
sensorType string “Ros_ Nav” Name of the sensor type yes
sampleRate double “100.0” Sample frequency in Hz yes
preview string “SmartIMU300.png” Preview icon to use in the Assets tab no
objectAsset string “GenericSensor” Name of the object asset to use for representing this sensor in the simulation yes
tags string “ANVEL_Common” Designates to the ANVEL asset system that this is a commonly used object no
positionCoordinateSystem bool “true” If false, the sensor will return position readings in WGS84 (deg, deg, m). Otherwise, it will return position readings in ANVEL's world coordinate frame (m, m, m). no
velocityInWorldFrame bool “true” If false, the sensor will return velocity in the sensor's local coordinate frame. no
accelerationInworldFrame bool “true” If false, the sensor will return acceleration in the sensor's local coordinate frame. no
reportGravity bool “false” If true, the sensor will factor gravity into the acceleration readings. no
attitudeRateInWorldFrame bool “true” If false, the sensor will return attitude rate in the sensor's local coordinate frame. no
odomTopicName string "Anvel_Odom_Data" Name of the nav_msgs::Odometry topic no
odomQueueSize uint32 “1” Size of the nav_msgs::Odometry topic queue no
tf Header Frame string “odom” Name of the reference coordinate frame for the ROS tf message no
tf Transform Frame string “base_link” Name of the transformed coordinate frame for the ROS tf message no

GenericLidarSensorDefinitions.xml

Below are the parameters used to define each sensor in the GenericLidarSensorDefinitions.xml file.

LIDAR PARAMETERS

Attribute Type Default value Description Required?
name string “ROS Lidar” Name of this sensor instance yes
sensorType string “Ros_ Lidar” Name of the sensor type yes
sampleRate double “36.0” Sample frequency in Hz yes
preview string “GenericLidar.png” Preview icon to use in the Assets tab no
objectAsset string “GenericLidar” Name of the object asset to use for representing this sensor in the simulation yes
tags string “ANVEL_Common” Designates to the ANVEL asset system that this is a commonly used object no
range double “0.0” ROS Lidar range no
minPitch double “0.0” ROS Lidar minPitch no
maxPitch double “0.0” ROS Lidar maxPitch no
pitch double “0.0” ROS Lidar pitch no
period double “0.0” ROS Lidar period no
horizontalFOV double “0.0” ROS Lidar horizontalFOV no
numRays uint32 “0.0” Number of ray increments around the entire 360° of rotation (with a reduced field of view, the number will be higher than the actual number of rays utilized) yes
a double “0.0” ROS Lidar required reflectivity a value no
b double “0.0” ROS Lidar required reflectivity b value no
c double “0.0” ROS Lidar required reflectivity c value no
relativeZ bool “false” Decides whether to report a points Z value as absolute or relative to vehicle; set to true if using ROS 2D Nav no
filterGround bool “true” Decides whether or not to report ground points no
lidarTopicName string "Anvel_Lidar_Data" Name of the sensor_msgs::PointCloud topic no
lidarQueueSize uint32 “1” Size of the sensor_msgs::PointCloud topic queue no
tfHeaderFrame string “base_link” Name of the reference coordinate frame for the ROS tf message no
tfTransformFrame string “lidar” Name of the transformed coordinate frame for the ROS tf message no
tfDataFrame string “odom” Name of the coordinate frame the lidar data is returned in for the sensor_msgs::PointCloud message no

See Also

ROS Examples