/look_at_with_style
#
Caution
This documentation page has been auto-generated.
It may be missing some details.
/look_at_with_style
Quick Facts
- Category
- Message type
hri_actions_msgs/LookAtWithStyle
- Direction
⬅️ you normally publish to this topic.
Set a target for the robot to look at, while letting you configure how the gaze will be performed.
Quick snippets#
Publish data on the topic#
$ rostopic pub /look_at_with_style hri_actions_msgs/LookAtWithStyle # press Tab twice to complete
How to use in your code#
Publish to the topic using Python#
1import rospy
2from hri_actions_msgs.msg import LookAtWithStyle
3
4if __name__ == "__main__":
5
6 rospy.init_node("publisher")
7
8 pub = rospy.Publisher("/look_at_with_style", LookAtWithStyle, queue_size=10)
9
10 rate = rospy.Rate(10) # 10Hz
11
12
13 msg = LookAtWithStyle()
14
15 while not rospy.is_shutdown():
16
17 # check hri_actions_msgs/LookAtWithStyle
18 # structure to fill the parameters. Eg:
19 # msg.data = ...
20 pub.publish(msg)
21
22 rate.sleep()
Publish to the topic using C++#
1#include <ros/ros.h>
2#include <hri_actions_msgs/LookAtWithStyle.h>
3
4int main(int argc, char **argv)
5{
6 ros::init(argc, argv, "publisher");
7 ros::NodeHandle n;
8
9 ros::Publisher pub = n.advertise<hri_actions_msgs::LookAtWithStyle>("/look_at_with_style", 10);
10
11 ros::Rate loop_rate(10); // 10Hz
12
13 while (ros::ok())
14 {
15 hri_actions_msgs::LookAtWithStyle msg;
16 // check hri_actions_msgs/LookAtWithStyle
17 // structure to fill the parameters. Eg:
18 // msg.data = ...
19 pub.publish(msg);
20
21 ros::spinOnce();
22 loop_rate.sleep();
23 }
24 return 0;
25}