Only released in EOL distros:
Package Summary
GUI primitives for HRI based on Interactive Markers provided by dcgm-robotics@FIT group.
- Author: Tomas Lokaj, Michal Spanel (spanel@fit.vutbr.cz)
- License: LGPL
- Source: git https://github.com/ipa320/srs_public.git (branch: master)
Package Summary
GUI primitives for HRI based on Interactive Markers provided by dcgm-robotics@FIT group.
- Author: Tomas Lokaj, Michal Spanel (spanel@fit.vutbr.cz)
- License: LGPL
- Source: git https://github.com/ipa320/srs_public.git (branch: master)
Package Summary
GUI primitives for HRI based on Interactive Markers provided by dcgm-robotics@FIT group.
- Author: Tomas Lokaj, Michal Spanel (spanel@fit.vutbr.cz)
- License: LGPL
- Source: git https://github.com/ipa320/srs_public.git (branch: master)
Contents
Overview
This package introduces GUI Primitives for HRI that are designed to visualize and illustrate objects detected by the robot. These primitives also allow to interact with particular objects and give commands to the robot via them. The primitives consists of Interactive Markers and are visualized in RViz.
All primitives have a context menu which allows some interaction and setting of the visualization (ability to show description of the primitive, add/remove manipulators for rotation and translation, etc.).
Following predefined types of primitives and are specified in srs_env_model/PrimitiveType message.
Billboard
- Billboard represents a real world object which is hard to describe with some mesh.
The billboard is view facing and iẗ́s type is specified in srs_interaction_primitives/BillboardType message.
- The billboard can also illustrate movement of the represented object, e.g. walking person.
Bounding Box
- Bounding Box illustrates dimensions of the object.
- The bounding box is able visualize its dimensions as text labels.
- The bounding box can be manually translated or rotated.
Object
- Object represents a detected or real-world object which has its mesh in an object database.
- Possible pre-grasp positions can be shown around the object. The visualization of pre-grasp positions aids operator to move gripper to a correct position for the grasping.
- The object can show its bounding box (if specified).
- The object can be manually rotated, translated and scaled in the scene.
Unknown Object
- Unknown Object represents obstacles, unreachable objects or dangerous places in the scene so that the operator will be able to avoid collisions or crashes of the robot.
- The unknown object can be manually rotated, translated and scaled in the scene.
Plane
- Plane shows only a simple plane which can be tagged as table desk, wall, etc.
Plane Polygon
- It's a variation of the Plane which is defined as a planar polygon.
- The plane polygon is shown as a transparent plane with the polygon inside it.
ROS API
Nodes
Node Name |
Published Topics |
Description |
but_interaction_primitives_service_server |
|
This node publishes but_interaction_primitives services. |
Services
All services starts with prefix /but_interaction_primitives
Service Name |
Input |
Output |
Description |
/add_billboard |
|
|
Adds billboard to the scene |
/add_bounding_box |
|
|
Adds Bounding Box to the scene |
/add_plane |
|
|
Adds Plane to the scene |
/add_plane_polygon |
|
|
Adds Plane Polygon to the scene |
/add_object |
|
|
Adds Object to the scene |
/add_unknown_object |
|
|
Add Unknown Object to the scene |
/remove_primitive |
|
|
Removes primitive form the scene |
/change_description |
|
|
|
/change_pose |
|
|
Changes primitive's description |
/change_scale |
|
|
Changes primitive's scale |
/change_color |
|
|
Changes primitive's color |
/change_direction |
|
|
Changes billboard's movement direction |
/change_velocity |
|
|
Changes billboard's movement velocity |
/set_pregrasp_position |
|
|
Sets pre-grasp position |
/remove_pregrasp_position |
|
|
Removes pre-grasp position |
/get_update_topic |
|
|
Gets update topic for specified action (type) |
Messages
Msg Name |
Content |
Description |
Types of Primitives |
||
Types of Billboard |
||
Message for update topic |
||
Message for update topic |
||
Message for update topic |
||
Message for update topic |
||
Message for update topic |
Published topics
All topics starts with prefix but_interaction_primitives.
Topic Name |
Message |
Description |
/primitive_name/update/pose_changed |
srs_interaction_primitives/PoseChanged |
Publishes pose changes of the primitive |
/primitive_name/update/scale_changed |
srs_interaction_primitives/ScaleChanged |
Publishes scale changes of the primitive |
/primitive_name/update/menu_clicked |
srs_interaction_primitives/MenuClicked |
Publishes information about menu interaction of the primitive |
/primitive_name/update/movement_changed |
srs_interaction_primitives/MovementChanged |
Publishes movement changes of the primitive (Billboard only) |
/primitive_name/update/tag_changed |
srs_interaction_primitives/TagChanged |
Publishes tag changes of the primitive (Plane only) |
Installation
Both components are in srs git in srs_interaction_primitives package and can be compiled with ROS standard tool rosmake
rosmake srs_interaction_primitives
Usage
Adding primitives from C++
1 // Create Interactive Marker Server
2 InteractiveMarkerServerPtr server;
3 server.reset(new InteractiveMarkerServer("test_primitives", "", false));
4
5 // Create billboard - /world is frame and my_billboard is primitives unique name
6 Billboard *billboard = new Billboard(server, "/world", "my_billboard");
7 billboard->setType(srs_interaction_primitives::BillboardType::PERSON); // type PERSON
8 billboard->setPose(pose); // actual position of the billboard
9 billboard->setScale(scale); // scale of the billboard
10 billboard->setDirection(direction); // actual movement direction
11 billboard->setVelocity(velocity); // actual movement velocity
12 billboard->setDescription("This is me!"); // description
13 billboard->insert(); // creates interaction primitive a inserts it into IMS
14
Using predefined services
- Run service server
rosrun srs_interaction_primitives but_interaction_primitives_service_server
- Run RViz
rosrun rviz rviz
Add Interactive Marker Display and set Update Topic to /but_interaction_primitives/update.
Now you can call services and add or update Primitives.
Calling services from bash
Add Bounding Box
rosservice call /but_interaction_primitives/add_bounding_box '{frame_id: /world, name: bbox, object_name: obj, description: "", pose: { position: { x: -1, y: 0, z: 0 }, orientation: { x: 0, y: 0, z: 0, w: 1 } }, scale: { x: 1, y: 1, z: 1 }, color: { r: 1, g: 0, b: 0 }}'
Add Billboard
rosservice call /but_interaction_primitives/add_billboard '{frame_id: /world, name: billboard, type: 2, description: "this is billboard", velocity: 5.6, direction: {x: 1, y: 1, z: 0, w: 1}, pose: {position: { x: -1, y: 0, z: 0 }, orientation: { x: 0, y: 0, z: 0, w: 1 } }, scale: { x: 1, y: 1, z: 1 }}'
Add Plane
rosservice call /but_interaction_primitives/add_plane '{frame_id: /world, name: plane, description: "", pose: { position: { x: -1, y: 0, z: 5 }, orientation: { x: 0, y: 1, z: 0, w: 1 } }, scale: { x: 1, y: 1, z: 1 }, color: { r: 1, g: 0.3, b: 0, a: 1.0 }}'
Add Object
rosservice call /but_interaction_primitives/add_object '{frame_id: /world, name: table_obj, description: "My table", pose: { position: { x: -1, y: 0, z: 0 }, orientation: { x: 0, y: 0, z: 0, w: 1 } }, scale: { x: 1, y: 1, z: 1 }, resource: "package://gazebo_worlds/Media/models/table.dae", use_material: false, color: {r: 1, g: 0, b: 1, a: 1 }}'
Add Unknown Object
rosservice call /but_interaction_primitives/add_unknown_object '{frame_id: /world, name: uobj, description: "", pose: { position: { x: -1, y: 0, z: 0 }, orientation: { x: 0, y: 0, z: 0, w: 1 } }, scale: { x: 1, y: 1, z: 1 } }'
Add Object
rosservice call /but_interaction_primitives/add_object '{frame_id: /world, name: milk, description: "Detected milk", pose: { position: { x: -1, y: 0, z: 0 }, orientation: { x: 0, y: 0, z: 0, w: 1 } }, bounding_box_lwh: {x: 1.0, y: 0.2, z: 0.1}, color: {r: 1, g: 1, b: 0}, resource: package://cob_gazebo_worlds/Media/models/milk_box.dae, use_material: True}'
Change pose
rosservice call /but_interaction_primitives/change_pose '{name: plane, pose: { position: { x: -1, y: 0, z: 0 }, orientation: { x: 0, y: 0, z: 0, w: 1 } }}'
Change scale
rosservice call /but_interaction_primitives/change_scale '{name: plane, scale: { x: 1.2, y: 2, z: 0.5 }}'
Change color
rosservice call /but_interaction_primitives/change_color '{name: plane, color: { r: 1, g: 0, b: 1, a: 0.5}}'
Change description
rosservice call /but_interaction_primitives/change_description '{name: plane, description: "something"}'
Set pre-grasp position
rosservice call /but_interaction_primitives/set_pregrasp_position '{name: object_name, pos_id: 1, position: {x: 0.2, y: 0.1, z: -0.5}}'
Remove pre-grasp position
rosservice call /but_interaction_primitives/remove_pregrasp_position '{name: object_name, pos_id: 1}'
Remove object
rosservice call /but_interaction_primitives/remove_object '{name: object_name}'
Calling services from C++
1 #include <ros/ros.h>
2 #include <srs_interaction_primitives/AddBoundingBox.h>
3
4 int main(int argc, char **argv)
5 {
6 // ROS initialization (the last argument is the name of the node)
7 ros::init(argc, argv, "interaction_primitives_client");
8
9 // NodeHandle is the main access point to communications with the ROS system
10 ros::NodeHandle n;
11
12 // Create a client for the add_bounding_box service
13 ros::ServiceClient bboxClient = n.serviceClient<srs_interaction_primitives::AddBoundingBox>("but_interaction_primitives/add_bounding_box");
14
15 // Set parameters to new Bounding Box
16 but_gui::AddBoundingBox bboxSrv;
17 bboxSrv.request.name = "Bounding box";
18 bboxSrv.request.object_name = "attached_object_name";
19 bboxSrv.request.frame_id = "/world";
20 bboxSrv.request.description = "This is Bounding Box";
21 bboxSrv.request.pose.position.x = 1.0;
22 bboxSrv.request.pose.position.y = 1.0;
23 bboxSrv.request.pose.position.z = 1.0;
24 bboxSrv.request.pose.orientation.x = 0.0;
25 bboxSrv.request.pose.orientation.y = 0.0;
26 bboxSrv.request.pose.orientation.z = 0.0;
27 bboxSrv.request.pose.orientation.w = 1.0;
28 bboxSrv.request.scale.x = 2.0;
29 bboxSrv.request.scale.y = 3.0;
30 bboxSrv.request.scale.z = 4.0;
31 bboxSrv.request.color.r = 1.0;
32 bboxSrv.request.color.g = 0.0;
33 bboxSrv.request.color.b = 1.0;
34 bboxSrv.request.color.a = 1.0;
35
36 // Call service with specified parameters
37 bboxClient.call(bboxSrv);
38
39 ros::spinOnce(); // Call all the callbacks waiting to be called
40
41 return 0;
42 }