Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YAML file lists the observers to be initialized #21

Open
hsd-dev opened this issue Nov 16, 2020 · 2 comments
Open

YAML file lists the observers to be initialized #21

hsd-dev opened this issue Nov 16, 2020 · 2 comments

Comments

@hsd-dev
Copy link
Owner

hsd-dev commented Nov 16, 2020

This can also include input params like link to the ROS models in case of ROSGraphObserver.

@hsd-dev
Copy link
Owner Author

hsd-dev commented Nov 16, 2020

http://wiki.ros.org/roslaunch/XML/rosparam#Examples

in launch file:

<rosparam command="load" file="$(find rosparam)/example.yaml" />

to access in python code:

ros::NodeHandle nh;
double number_to_get;
nh.getParam("/custom_prefix/number_float", number_to_get);

Another option is to set param as path to YAML file and use YAML module in python to load and read file:
https://github.com/udacity/CarND-Capstone/blob/master/ros/src/camera_info_publisher/yaml_to_camera_info_publisher.py

@hsd-dev
Copy link
Owner Author

hsd-dev commented Nov 16, 2020

Example file:

observers:
  - name: QualityObserver
      - topic: /speed
        type: std_msgs/Float64
      - topic: /accel
        type: std_msgs/Int32
      - hz: 100
  - name: ROSGraphIbserver
      - model: resources/talker_listener.rossystem
      - hz: 10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant