Add a sim argument to ada_imu.launch.py and a corresponding parameter to imu_jointstate_publisher.py. This argument should be able to take on values of either mock or real.
In imu_jointstate_publisher.py, if sim!="real", then don't load the serial port and always assume the imu_angle is 0. Also, if there is any error reading from the serial port, asusme the imu angle is always 0.
In ada_moveitdemo.launch.py, include ada_imu.launch.py with the sim argument set to the same value that is passed in to the moveit launch file.
Testing
Run ros2 launch ada_moveit demo.launch.py sim:=mock
[x] Run ros2 run tf2_tools view_frames and verify that the output is a single connected TF tree.
Run ros2 launch ada_moveit demo.launch.py with the IMU unplugged.
[x] Run ros2 run tf2_tools view_frames and verify that it logs an error but world->root is still in the same TF tree as the robot.
Run ros2 launch ada_moveit demo.launch.py with the IMU plugged in.
[x] Run ros2 run tf2_tools view_frames and verify that the output is a single connected TF tree.
[x] Tilt the wheelchair and verify that the robot in RVIZ rotates accordingly.
[x] Unplug the IMU and verify that the node doesn't crash, but rather logs an error and continues publishing 0 (verify this by ensuring there is still one connected TF tree)
Description
In service of #14, this PR does the following:
sim
argument toada_imu.launch.py
and a corresponding parameter toimu_jointstate_publisher.py
. This argument should be able to take on values of eithermock
orreal
.imu_jointstate_publisher.py
, ifsim!="real"
, then don't load the serial port and always assume theimu_angle
is 0. Also, if there is any error reading from the serial port, asusme the imu angle is always 0.ada_moveit
demo.launch.py
, includeada_imu.launch.py
with thesim
argument set to the same value that is passed in to the moveit launch file.Testing
ros2 launch ada_moveit demo.launch.py sim:=mock
ros2 run tf2_tools view_frames
and verify that the output is a single connected TF tree.ros2 launch ada_moveit demo.launch.py
with the IMU unplugged.ros2 run tf2_tools view_frames
and verify that it logs an error butworld->root
is still in the same TF tree as the robot.ros2 launch ada_moveit demo.launch.py
with the IMU plugged in.ros2 run tf2_tools view_frames
and verify that the output is a single connected TF tree.Before Merging
python3 -m black .