Coder Social home page Coder Social logo

Comments (3)

clalancette avatar clalancette commented on July 29, 2024

So you are getting to the constructor of the class:

[component_container-1] [INFO] [phidgets_spatial]: Starting Phidgets Spatial

But you are not getting to where it tries to connect to the device. The next line you should see is something like:

[component_container-1] [INFO] [phidgets_spatial]: Connecting to Phidgets Spatial serial -1, hub port 0 ...

The only things that happen between those two prints are getting and checking of parameters. So I'd guess that one of your parameters is either declared as an invalid type, or with an invalid value. What does your parameter configuration file look like?

from phidgets_drivers.

Chiasung avatar Chiasung commented on July 29, 2024

Hi @clalancette ,

Here is my params.yaml and launch file.

phidgets_spatial:
  ros__parameters:
    hub_port: 0
    frame_id: "imu_link"
    linear_acceleration_stdev: 0.002744
    angular_velocity_stdev: 0.087266463
    magnetic_field_stdev: 0.0000011
    time_resynchronization_interval_ms: 5000
    data_interval_ms: 8
    callback_delta_epsilon_ms: 1
    publish_rate: 100
# Copyright 2019 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Launch a Phidgets spatial in a component container."""

import launch
from launch_ros.actions import ComposableNodeContainer
from launch_ros.descriptions import ComposableNode


"""Load Configuration File"""
param_file = os.getcwd() + '/params.yaml'
node_remaps=[]
if os.path.isfile(param_file):
    node_remaps += [('__params', param_file)]
    launch_print("Using parameters file: " + param_file)
else:
    launch_print("Parameters file not found: " + param_file)


def generate_launch_description():
    """Generate launch description with multiple components."""
    container = ComposableNodeContainer(
            node_name='phidget_container',
            node_namespace='',
            package='rclcpp_components',
            node_executable='component_container',
            composable_node_descriptions=[
                ComposableNode(
                    package='phidgets_spatial',
                    node_plugin='phidgets::SpatialRosI',
                    node_name='phidgets_spatial'),
            ],
            output='both',
    )

    return launch.LaunchDescription([container])

from phidgets_drivers.

clalancette avatar clalancette commented on July 29, 2024
publish_rate: 100

That's your problem. Currently ROS 2 doesn't accept integers for double fields, and the publish rate is a double. Change that to 100.0, and it will most likely work.

I'm going to close this out, but feel free to reopen if this doesn't fix your problem.

from phidgets_drivers.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.