ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Raoryn's profile - activity

2022-03-08 07:52:33 -0500 received badge  Student (source)
2021-12-09 08:40:09 -0500 received badge  Famous Question (source)
2021-08-09 16:05:41 -0500 received badge  Famous Question (source)
2021-05-18 07:55:14 -0500 received badge  Notable Question (source)
2021-05-18 07:55:14 -0500 received badge  Popular Question (source)
2021-05-11 05:02:51 -0500 asked a question ROS2 how to make a node read files

ROS2 how to make a node read files hi, i've made a ros2 node that outputs a msg to another node. the problem comes when

2021-05-10 16:08:08 -0500 received badge  Notable Question (source)
2021-05-09 07:23:48 -0500 commented answer ROS2 sending multiple inputs msg

thank you so much! this with the other post made it work

2021-05-09 07:23:07 -0500 marked best answer ROS2 sending multiple inputs msg

hi, im trying to send four floats like 20.0,20.0,320.0,20.0 in a msg on a publisher node, but it realy doesnt like to send the numbers.

import rclpy
# from OpenCVnodetest import cameraModule
from rclpy.node import Node

from std_msgs.msg import Float64MultiArray

class Anglepublisher(Node):
    # _camera_module = cameraModule()
    def __init__(self):
        super().__init__("maximumLikelihood")
        self.publisher_ = self.create_publisher(Float64MultiArray,'Angles',10)
        timer_period = 0.5
        self.timer = self.create_timer(timer_period,self.timer_callback)
        self.i = 0

    def timer_callback(self):
        msg = Float64MultiArray()
        msg.data = [(20.0,20.0,320.0.i,20.0)]
        self.publisher_.publish(msg)
        self.get_logger().info('Publishing: ',msg.data)
        self.i +=1

def main(args=None):
    rclpy.init(args=args)
    anglepublisher = Anglepublisher()

    rclpy.spin(anglepublisher)

    anglepublisher.destroy_node()

    rclpy.shutdown()



if __name__ == '__main__':
    main()

we have been looking at making a custom msg type but so far not successfull with finding the right type if we actualy did it the right way. is making a custom msg type the right way or does it already excist a type that works in our problem?

2021-05-09 07:23:06 -0500 received badge  Scholar (source)
2021-05-09 07:22:55 -0500 commented answer ROS2 sending multiple inputs msg

thaaank you so much! was loosing some hair trying to figure this out, 30 min after reading your post it started to work.

2021-05-09 07:21:55 -0500 received badge  Supporter (source)
2021-05-09 04:10:19 -0500 received badge  Popular Question (source)
2021-05-08 23:09:53 -0500 asked a question ROS2 sending multiple inputs msg

ROS2 sending multiple inputs msg hi, im trying to send four floats like 20.0,20.0,320.0,20.0 in a msg on a publisher nod