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

Gendrv Issue #53

Closed
pitosalas opened this issue Jan 27, 2025 · 8 comments
Closed

Gendrv Issue #53

pitosalas opened this issue Jan 27, 2025 · 8 comments

Comments

@pitosalas
Copy link

pitosalas commented Jan 27, 2025

I am having trouble getting the Waveshare gendrv board fully working. This issue report looks long but it's just because I put all the details in. I think I might be misunderstanding some detail in your instructions because of how you interleave instructions for gendrv with all the others.

I have followed your instructions carefully and it is mostly working. I hope you can take a few minutes and look through this and help me spot my mistake. My meaning is to follow the default path through your instructions.

I've spent a lot of time digging into the underlying packages (like ekf_filter_node and imu_filter_madwick) and I don't see where I am going wrong. THANK YOU!

My gendrv_config.h looks like this:


// Copyright (c) 2021 Juan Miguel Jimeno
//
// 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.

#ifndef GENDRV_CONFIG_H
#define GENDRV_CONFIG_H

#define LED_PIN LED_BUILTIN //used for debugging status

//uncomment the base you're building
#define LINO_BASE DIFFERENTIAL_DRIVE       // 2WD and Tracked robot w/ 2 motors
// #define LINO_BASE SKID_STEER            // 4WD robot
// #define LINO_BASE MECANUM               // Mecanum drive robot

//uncomment the motor driver you're using
// #define USE_GENERIC_2_IN_MOTOR_DRIVER      // Motor drivers with 2 Direction Pins(INA, INB) and 1 PWM(ENABLE) pin ie. L298, L293, VNH5019
// #define USE_GENERIC_1_IN_MOTOR_DRIVER   // Motor drivers with 1 Direction Pin(INA) and 1 PWM(ENABLE) pin.
#define USE_BTS7960_MOTOR_DRIVER        // BTS7970 Motor Driver
// #define USE_ESC_MOTOR_DRIVER            // Motor ESC for brushless motors

//uncomment the IMU you're using
// #define USE_GY85_IMU
// #define USE_MPU6050_IMU
// #define USE_MPU9150_IMU
// #define USE_MPU9250_IMU
#define USE_QMI8658_IMU
// #define USE_HMC5883L_MAG
// #define USE_AK8963_MAG
// #define USE_AK8975_MAG
#define USE_AK09918_MAG
// #define USE_QMC5883L_MAG

#define MAG_BIAS { 1.32662e-05, -5.43438e-05, 1.06151e-05 } //magnetometer bias
// #define IMU_TWEAK {}
// #define MAG_TWEAK {}

#define K_P 0.6                             // P constant
#define K_I 0.8                             // I constant
#define K_D 0.5                             // D constant

// #define K_P 3.0                            // P constant
// #define K_I 0.0                             // I constant
// #define K_D 0.0                             // D constant


#define ACCEL_COV { 0.01, 0.01, 0.01 }
#define GYRO_COV { 0.001, 0.001, 0.001 }
#define ORI_COV { 0.01, 0.01, 0.01 }
#define MAG_COV { 1e-12, 1e-12, 1e-12 }
#define POSE_COV { 0.001, 0.001, 0.001, 0.001, 0.001, 0.001 }
#define TWIST_COV { 0.001, 0.001, 0.001, 0.003, 0.003, 0.003 }

/*
ROBOT ORIENTATION
         FRONT
    MOTOR1  MOTOR2  (2WD/ACKERMANN)
    MOTOR3  MOTOR4  (4WD/MECANUM)
         BACK
*/

//define your robot' specs here
#define MOTOR_MAX_RPM 300                   // motor's max RPM
#define MAX_RPM_RATIO 0.85                  // max RPM allowed for each MAX_RPM_ALLOWED = MOTOR_MAX_RPM * MAX_RPM_RATIO
#define MOTOR_OPERATING_VOLTAGE 12          // motor's operating voltage (used to calculate max RPM)
#define MOTOR_POWER_MAX_VOLTAGE 12          // max voltage of the motor's power source (used to calculate max RPM)
#define MOTOR_POWER_MEASURED_VOLTAGE 12     // current voltage reading of the power connected to the motor (used for calibration)
#define COUNTS_PER_REV1 985                 // wheel1 encoder's no of ticks per rev
#define COUNTS_PER_REV2 985                 // wheel2 encoder's no of ticks per rev
#define COUNTS_PER_REV3 450                 // wheel3 encoder's no of ticks per rev
#define COUNTS_PER_REV4 450                 // wheel4 encoder's no of ticks per rev
#define WHEEL_DIAMETER 0.06                // wheel's diameter in meters
#define LR_WHEELS_DISTANCE 0.2375           // distance between left and right wheels
#define PWM_BITS 10                         // PWM Resolution of the microcontroller
#define PWM_FREQUENCY 20000                 // PWM Frequency
#define SERVO_BITS 12                       // Servo PWM resolution
#define SERVO_FREQ 50                       // Servo PWM frequency

// INVERT ENCODER COUNTS
#define MOTOR1_ENCODER_INV true
#define MOTOR2_ENCODER_INV true
#define MOTOR3_ENCODER_INV false
#define MOTOR4_ENCODER_INV false

// INVERT MOTOR DIRECTIONS
#define MOTOR1_INV false
#define MOTOR2_INV false
#define MOTOR3_INV false
#define MOTOR4_INV false

// ENCODER PINS
#define MOTOR1_ENCODER_A 34
#define MOTOR1_ENCODER_B 35

#define MOTOR2_ENCODER_A 16
#define MOTOR2_ENCODER_B 27

#define MOTOR3_ENCODER_A -1
#define MOTOR3_ENCODER_B -1

#define MOTOR4_ENCODER_A -1
#define MOTOR4_ENCODER_B -1

// MOTOR PINS
#ifdef USE_GENERIC_2_IN_MOTOR_DRIVER
  #define MOTOR1_PWM 25 //Pin no 21 is not a PWM pin on Teensy 4.x, you can swap it with pin no 1 instead.
  #define MOTOR1_IN_A 21
  #define MOTOR1_IN_B 17

  #define MOTOR2_PWM 26
  #define MOTOR2_IN_A 22
  #define MOTOR2_IN_B 23

  #define MOTOR3_PWM -1
  #define MOTOR3_IN_A -1
  #define MOTOR3_IN_B -1

  #define MOTOR4_PWM -1
  #define MOTOR4_IN_A -1
  #define MOTOR4_IN_B -1

  #define PWM_MAX pow(2, PWM_BITS) - 1
  #define PWM_MIN -PWM_MAX
#endif

#ifdef USE_GENERIC_1_IN_MOTOR_DRIVER
  #define MOTOR1_PWM 21 //Pin no 21 is not a PWM pin on Teensy 4.x, you can use pin no 1 instead.
  #define MOTOR1_IN_A 20
  #define MOTOR1_IN_B -1 //DON'T TOUCH THIS! This is just a placeholder

  #define MOTOR2_PWM 5
  #define MOTOR2_IN_A 6
  #define MOTOR2_IN_B -1 //DON'T TOUCH THIS! This is just a placeholder

  #define MOTOR3_PWM 22
  #define MOTOR3_IN_A 23
  #define MOTOR3_IN_B -1 //DON'T TOUCH THIS! This is just a placeholder

  #define MOTOR4_PWM 4
  #define MOTOR4_IN_A 3
  #define MOTOR4_IN_B -1 //DON'T TOUCH THIS! This is just a placeholder

  #define PWM_MAX pow(2, PWM_BITS) - 1
  #define PWM_MIN -PWM_MAX
#endif

#ifdef USE_BTS7960_MOTOR_DRIVER
  #define MOTOR1_PWM 25 //DON'T TOUCH THIS! This is just a placeholder
  #define MOTOR1_IN_A 17
  #define MOTOR1_IN_B 21

  #define MOTOR2_PWM 26 //DON'T TOUCH THIS! This is just a placeholder
  #define MOTOR2_IN_A 23
  #define MOTOR2_IN_B 22

  #define MOTOR3_PWM -1 //DON'T TOUCH THIS! This is just a placeholder
  #define MOTOR3_IN_A -1
  #define MOTOR3_IN_B -1

  #define MOTOR4_PWM -1 //DON'T TOUCH THIS! This is just a placeholder
  #define MOTOR4_IN_A -1
  #define MOTOR4_IN_B -1

  #define PWM_MAX pow(2, PWM_BITS) - 1
  #define PWM_MIN -PWM_MAX
#endif

#ifdef USE_ESC_MOTOR_DRIVER
  #define MOTOR1_PWM 21 //Pin no 21 is not a PWM pin on Teensy 4.x. You can use pin no 1 instead.
  #define MOTOR1_IN_A -1 //DON'T TOUCH THIS! This is just a placeholder
  #define MOTOR1_IN_B -1 //DON'T TOUCH THIS! This is just a placeholder

  #define MOTOR2_PWM 5
  #define MOTOR2_IN_A -1 //DON'T TOUCH THIS! This is just a placeholder
  #define MOTOR2_IN_B -1 //DON'T TOUCH THIS! This is just a placeholder

  #define MOTOR3_PWM 22
  #define MOTOR3_IN_A -1 //DON'T TOUCH THIS! This is just a placeholder
  #define MOTOR3_IN_B -1 //DON'T TOUCH THIS! This is just a placeholder

  #define MOTOR4_PWM 4
  #define MOTOR4_IN_A -1 //DON'T TOUCH THIS! This is just a placeholder
  #define MOTOR4_IN_B -1 //DON'T TOUCH THIS! This is just a placeholder

  #define PWM_MAX 400
  #define PWM_MIN -PWM_MAX
#endif

#define AGENT_IP { 192, 168, 1, 100 }  // eg IP of the desktop computer
#define AGENT_PORT 8888
// Enable WiFi with null terminated list of multiple APs SSID and password
// #define WIFI_AP_LIST {{"WIFI_SSID", "WIFI_PASSWORD"}, {NULL}}
#define WIFI_MONITOR 2 // min. period to send wifi signal strength to syslog
// #define USE_ARDUINO_OTA
// #define USE_SYSLOG
#define SYSLOG_SERVER { 192, 168, 1, 100 }  // eg IP of the desktop computer
#define SYSLOG_PORT 514
#define DEVICE_HOSTNAME "gendrv"
#define APP_NAME "hardware"
// #define USE_LIDAR_UDP  // send lidar data to udp server
#define LIDAR_RXD 4
#define LIDAR_SERIAL 1 // uart number
#define LIDAR_BAUDRATE 230400
#define LIDAR_SERVER { 192, 168, 1, 100 }  // eg IP of the desktop computer
#define LIDAR_PORT 8889
#define BAUDRATE 921600
#define SDA_PIN 32 // specify I2C pins
#define SCL_PIN 33
#define NODE_NAME "gendrv"
// #define TOPIC_PREFIX "gendrv/"
// #define CONTROL_TIMER 20
// #define BATTERY_TIMER 2000

// battery voltage ADC pin
// #define BATTERY_PIN 33
// 3.3V ref, 12 bits ADC, 33k + 10k voltage divider
#define BATTERY_ADJUST(v) ((v) * (3.3 / 4096 * (33 + 10) / 10))
#define USE_INA219
#define BATTERY_DIP 0.98  // battery voltage drop alert
// #define BATTERY_CAP 2.0  // battery capacity Ah
// #define BATTERY_MIN 9.0  // battery minimal voltage
// #define BATTERY_MAX 12.6 // battery maximum voltage
// #define TRIG_PIN 31 // ultrasonic sensor HC-SR04
// #define ECHO_PIN 32
#define USE_SHORT_BRAKE // for shorter stopping distance
// #define WDT_TIMEOUT 60 // Sec
#define BOARD_INIT { \
    pinMode(MOTOR1_PWM, OUTPUT); \
    digitalWrite(MOTOR1_PWM, HIGH); \
    pinMode(MOTOR2_PWM, OUTPUT); \
    digitalWrite(MOTOR2_PWM, HIGH); \
    Wire.begin(SDA_PIN, SCL_PIN); \
    Wire.setClock(400000); \
}
// #define BOARD_INIT_LATE {}
// #define BOARD_LOOP {}

#ifdef USE_SYSLOG
#define RCCHECK(fn) { rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){ \
    syslog(LOG_ERR, "%s RCCHECK failed %d", __FUNCTION__, temp_rc); \
    return false; }}
#else
#define RCCHECK(fn) { rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){ \
    flashLED(3); \
    return false; }} // do not block
#endif

#endif

IMU set up

I have set up the imu. It is publishing to imu/data_raw which is expected to because of the presence of the mangetometer. The data from /imu/data_raw and /imu/magnet seems correct. A little lower hz but maybe that's because it's an ESP32.

/imu topics hz reports

[dome:~] ros2 topic hz /imu/data_raw
average rate: 38.408
	min: 0.025s max: 0.029s std dev: 0.00107s window: 40
average rate: 38.323
	min: 0.025s max: 0.030s std dev: 0.00113s window: 79
^C[dome:~] ros2 topic hz /imu/mag
WARNING: topic [/imu/mag] does not appear to be published yet
average rate: 38.520
	min: 0.025s max: 0.029s std dev: 0.00111s window: 40
average rate: 38.425
	min: 0.025s max: 0.029s std dev: 0.00116s window: 79
average rate: 38.460
	min: 0.025s max: 0.029s std dev: 0.00118s window: 118

My ekf.yaml looks like this:

ekf_filter_node:
    ros__parameters:
        frequency: 50.0
        two_d_mode: true
        publish_tf: true
 
        map_frame: map             
        odom_frame: odom            
        base_link_frame: base_footprint 
        world_frame: odom 


        #x     , y     , z,
        #roll  , pitch , yaw,
        #vx    , vy    , vz,
        #vroll , vpitch, vyaw,
        #ax    , ay    , az
        odom0: odom/unfiltered
        odom0_config: [false, false, false,
                       false, false, false,
                       true, true, false,
                       false, false, true,
                       false, false, false]

        imu0: imu/data
        imu0_config: [false, false, false,
                      false, false, true,
                      false, false, false,
                      false, false, true,
                      true, true, false]

Bringup

And I launch with the following bringup:


# Copyright (c) 2021 Juan Miguel Jimeno
#
# 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.

from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription
from launch.substitutions import LaunchConfiguration, PathJoinSubstitution, PythonExpression
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch_ros.actions import Node
from launch_ros.substitutions import FindPackageShare
from launch.conditions import IfCondition, UnlessCondition


def generate_launch_description():
    sensors_launch_path = PathJoinSubstitution(
        [FindPackageShare('linorobot2_bringup'), 'launch', 'sensors.launch.py']
    )

    joy_launch_path = PathJoinSubstitution(
        [FindPackageShare('linorobot2_bringup'), 'launch', 'joy_teleop.launch.py']
    )

    description_launch_path = PathJoinSubstitution(
        [FindPackageShare('linorobot2_description'), 'launch', 'description.launch.py']
    )

    ekf_config_path = PathJoinSubstitution(
        [FindPackageShare("linorobot2_base"), "config", "ekf.yaml"]
    )

    default_robot_launch_path = PathJoinSubstitution(
        [FindPackageShare('linorobot2_bringup'), 'launch', 'default_robot.launch.py']
    )

    custom_robot_launch_path = PathJoinSubstitution(
        [FindPackageShare('linorobot2_bringup'), 'launch', 'custom_robot.launch.py']
    )

    extra_launch_path = PathJoinSubstitution(
        [FindPackageShare('linorobot2_bringup'), 'launch', 'extra.launch.py']
    )

    return LaunchDescription([
        DeclareLaunchArgument(
            name='custom_robot', 
            default_value='false',
            description='Use custom robot'
        ),

        DeclareLaunchArgument(
            name='extra', 
            default_value='false',
            description='Launch extra launch file'
        ),

        DeclareLaunchArgument(
            name='base_serial_port', 
            default_value='/dev/serial/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.3:1.0-port0',
            description='Linorobot Base Serial Port'
        ),

        DeclareLaunchArgument(
            name='micro_ros_transport',
            default_value='serial',
            description='micro-ROS transport'
        ),

        DeclareLaunchArgument(
            name='micro_ros_port',
            default_value='8888',
            description='micro-ROS udp/tcp port number'
        ),

        DeclareLaunchArgument(
            name='odom_topic', 
            default_value='/odom',
            description='EKF out odometry topic'
        ),

        DeclareLaunchArgument(
            name='madgwick',
            default_value='true',
            description='Use madgwick to fuse imu and magnetometer'
        ),

        DeclareLaunchArgument(
            name='orientation_stddev',
            default_value='0.003162278',
            description='Madgwick orientation stddev'
        ),

        DeclareLaunchArgument(
            name='joy', 
            default_value='false',
            description='Use Joystick'
        ),

        Node(
            condition=IfCondition(LaunchConfiguration("madgwick")),
            package='imu_filter_madgwick',
            executable='imu_filter_madgwick_node',
            name='madgwick_filter_node',
            output='screen',
            parameters=[
                {'orientation_stddev' : LaunchConfiguration('orientation_stddev')}
            ]
        ),

        Node(
            package='robot_localization',
            executable='ekf_node',
            name='ekf_filter_node',
            output='screen',
            parameters=[
                ekf_config_path
            ],
            remappings=[("odometry/filtered", LaunchConfiguration("odom_topic"))]
        ),

        IncludeLaunchDescription(
            PythonLaunchDescriptionSource(default_robot_launch_path),
            condition=UnlessCondition(LaunchConfiguration("custom_robot")),
            launch_arguments={
                'base_serial_port': LaunchConfiguration("base_serial_port")
            }.items()
        ),

        IncludeLaunchDescription(
            PythonLaunchDescriptionSource(extra_launch_path),
            condition=IfCondition(LaunchConfiguration("extra")),
        ),

        IncludeLaunchDescription(
            PythonLaunchDescriptionSource(custom_robot_launch_path),
            condition=IfCondition(LaunchConfiguration("custom_robot")),
        )
    ])

Which is pretty straightforward. .And the output also looks perfect:

[dome:~] ros2 launch linorobot2_bringup bringup.launch.py
[INFO] [launch]: All log files can be found below /home/pitosalas/.ros/log/2025-01-26-20-32-37-017623-dome-2435
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [imu_filter_madgwick_node-1]: process started with pid [2437]
[INFO] [ekf_node-2]: process started with pid [2439]
[INFO] [micro_ros_agent-3]: process started with pid [2441]
[INFO] [joint_state_publisher-4]: process started with pid [2443]
[INFO] [robot_state_publisher-5]: process started with pid [2445]
[micro_ros_agent-3] [1737941558.688829] info     | TermiosAgentLinux.cpp | init                     | running...             | fd: 3
[micro_ros_agent-3] [1737941558.690808] info     | Root.cpp           | set_verbose_level        | logger setup           | verbose_level: 4
[imu_filter_madgwick_node-1] [INFO] [1737941558.911784478] [madgwick_filter_node]: Starting ImuFilter
[imu_filter_madgwick_node-1] [INFO] [1737941558.913986172] [madgwick_filter_node]: Using dt computed from message headers
[imu_filter_madgwick_node-1] [INFO] [1737941558.914914835] [madgwick_filter_node]: The gravity vector is kept in the IMU message.
[imu_filter_madgwick_node-1] [INFO] [1737941558.915859016] [madgwick_filter_node]: Imu filter gain set to 0.100000
[imu_filter_madgwick_node-1] [INFO] [1737941558.915985626] [madgwick_filter_node]: Gyro drift bias set to 0.000000
[imu_filter_madgwick_node-1] [INFO] [1737941558.916020978] [madgwick_filter_node]: Magnetometer bias values: 0.000000 0.000000 0.000000
[robot_state_publisher-5] [INFO] [1737941559.017753277] [robot_state_publisher]: got segment base_footprint
[robot_state_publisher-5] [INFO] [1737941559.018699606] [robot_state_publisher]: got segment base_link
[robot_state_publisher-5] [INFO] [1737941559.018820087] [robot_state_publisher]: got segment camera_depth_link
[robot_state_publisher-5] [INFO] [1737941559.018861735] [robot_state_publisher]: got segment camera_link
[robot_state_publisher-5] [INFO] [1737941559.018891883] [robot_state_publisher]: got segment front_caster_wheel_link
[robot_state_publisher-5] [INFO] [1737941559.018921291] [robot_state_publisher]: got segment imu_link
[robot_state_publisher-5] [INFO] [1737941559.018954568] [robot_state_publisher]: got segment laser
[robot_state_publisher-5] [INFO] [1737941559.018980901] [robot_state_publisher]: got segment left_wheel_link
[robot_state_publisher-5] [INFO] [1737941559.019007383] [robot_state_publisher]: got segment rear_caster_wheel_link
[robot_state_publisher-5] [INFO] [1737941559.019033586] [robot_state_publisher]: got segment right_wheel_link
[robot_state_publisher-5] [INFO] [1737941559.019060771] [robot_state_publisher]: got segment sonar_link
[micro_ros_agent-3] [1737941559.172003] info     | Root.cpp           | create_client            | create                 | client_key: 0x2CF3503A, session_id: 0x81
[micro_ros_agent-3] [1737941559.174546] info     | SessionManager.hpp | establish_session        | session established    | client_key: 0x2CF3503A, address: 0
[micro_ros_agent-3] [1737941559.236455] info     | ProxyClient.cpp    | create_participant       | participant created    | client_key: 0x2CF3503A, participant_id: 0x000(1)
[micro_ros_agent-3] [1737941559.241098] info     | ProxyClient.cpp    | create_topic             | topic created          | client_key: 0x2CF3503A, topic_id: 0x000(2), participant_id: 0x000(1)
[micro_ros_agent-3] [1737941559.244672] info     | ProxyClient.cpp    | create_publisher         | publisher created      | client_key: 0x2CF3503A, publisher_id: 0x000(3), participant_id: 0x000(1)
[micro_ros_agent-3] [1737941559.249848] info     | ProxyClient.cpp    | create_datawriter        | datawriter created     | client_key: 0x2CF3503A, datawriter_id: 0x000(5), publisher_id: 0x000(3)
[micro_ros_agent-3] [1737941559.254031] info     | ProxyClient.cpp    | create_topic             | topic created          | client_key: 0x2CF3503A, topic_id: 0x001(2), participant_id: 0x000(1)
[micro_ros_agent-3] [1737941559.257495] info     | ProxyClient.cpp    | create_publisher         | publisher created      | client_key: 0x2CF3503A, publisher_id: 0x001(3), participant_id: 0x000(1)
[micro_ros_agent-3] [1737941559.263481] info     | ProxyClient.cpp    | create_datawriter        | datawriter created     | client_key: 0x2CF3503A, datawriter_id: 0x001(5), publisher_id: 0x001(3)
[micro_ros_agent-3] [1737941559.267806] info     | ProxyClient.cpp    | create_topic             | topic created          | client_key: 0x2CF3503A, topic_id: 0x002(2), participant_id: 0x000(1)
[micro_ros_agent-3] [1737941559.271348] info     | ProxyClient.cpp    | create_publisher         | publisher created      | client_key: 0x2CF3503A, publisher_id: 0x002(3), participant_id: 0x000(1)
[micro_ros_agent-3] [1737941559.277392] info     | ProxyClient.cpp    | create_datawriter        | datawriter created     | client_key: 0x2CF3503A, datawriter_id: 0x002(5), publisher_id: 0x002(3)
[micro_ros_agent-3] [1737941559.283414] info     | ProxyClient.cpp    | create_topic             | topic created          | client_key: 0x2CF3503A, topic_id: 0x003(2), participant_id: 0x000(1)
[micro_ros_agent-3] [1737941559.287764] info     | ProxyClient.cpp    | create_publisher         | publisher created      | client_key: 0x2CF3503A, publisher_id: 0x003(3), participant_id: 0x000(1)
[micro_ros_agent-3] [1737941559.296514] info     | ProxyClient.cpp    | create_datawriter        | datawriter created     | client_key: 0x2CF3503A, datawriter_id: 0x003(5), publisher_id: 0x003(3)
[micro_ros_agent-3] [1737941559.300748] info     | ProxyClient.cpp    | create_topic             | topic created          | client_key: 0x2CF3503A, topic_id: 0x004(2), participant_id: 0x000(1)
[micro_ros_agent-3] [1737941559.304181] info     | ProxyClient.cpp    | create_subscriber        | subscriber created     | client_key: 0x2CF3503A, subscriber_id: 0x000(4), participant_id: 0x000(1)
[micro_ros_agent-3] [1737941559.310181] info     | ProxyClient.cpp    | create_datareader        | datareader created     | client_key: 0x2CF3503A, datareader_id: 0x000(6), subscriber_id: 0x000(4)
[imu_filter_madgwick_node-1] [INFO] [1737941559.347430177] [madgwick_filter_node]: First pair of IMU and magnetometer messages received.
[joint_state_publisher-4] [INFO] [1737941560.837289555] [joint_state_publisher]: Waiting for robot_description to be published on the robot_description topic...

Problems

After this I have the following weirdness... The imu_link tf is a child of the odom tf which is incorrect.

Image

Also another clue is this error:

Image

Question

Do you see anything in my various setup files that might be causing this?

@hippo5329
Copy link
Owner

The problem came from the madgwick package, which used "fixed_frame"(default odom) as parent . But it should not be odom in our cases.

@hippo5329
Copy link
Owner

I think we can set "publish_tf" to false, because we do not use wadgwick package to publish tf. We use robot_state_publisher to publish tf. So the tf publisher from madgwick should be disabled.

@hippo5329
Copy link
Owner

I will prepare a patch on this later.

@pitosalas
Copy link
Author

pitosalas commented Jan 27, 2025 via email

@pitosalas
Copy link
Author

pitosalas commented Jan 28, 2025 via email

@hippo5329
Copy link
Owner

Please check hippo5329/linorobot2 no-tf branch. I am traveling and do not have robots to test.

@pitosalas
Copy link
Author

pitosalas commented Jan 29, 2025 via email

@hippo5329
Copy link
Owner

I updated hippo5329/linorobot2. And checked via view_frame. The imu_link's parent is base_footprint now.

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

2 participants