Question:
Moveit failed to find the robot model when using manual moveit configuration

I'm facing an issue on moveit when I try to manually configure the robot model in moveit. I'm getting errors in the robot model when trying to launch moveit launch file in the following sequence below and I mimic joint 4 in the opposite direction to perform a grasp using a gripper in my robot model. Here is my GitHub repo

This is my output in the terminal when I run in a sequence gazebo.launch.py, controller.launch.py followed by moveit.launch.py.

damarla@damarla:~/ros2control$ ros2 launch arm_robot_moveit moveit.launch.py
[INFO] [launch]: All log files can be found below /home/damarla/.ros/log/2023-09-06-17-00-22-607579-damarla-11097
[INFO] [launch]: Default logging verbosity is set to INFO
WARNING:root:Cannot infer URDF from `/home/damarla/ros2control/install/arm_robot_moveit/share/arm_robot_moveit`. -- using config/arm_robot.urdf
WARNING:root:Cannot infer SRDF from `/home/damarla/ros2control/install/arm_robot_moveit/share/arm_robot_moveit`. -- using config/arm_robot.srdf
[INFO] [move_group-1]: process started with pid [11102]
[INFO] [rviz2-2]: process started with pid [11104]
[rviz2-2] Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
[move_group-1] [INFO] [1694012423.431871548] [moveit_rdf_loader.rdf_loader]: Loaded robot model in 0 seconds
[move_group-1] [INFO] [1694012423.433388806] [moveit_robot_model.robot_model]: Loading robot model 'arm_robot'...
[move_group-1] [INFO] [1694012423.434358278] [moveit_robot_model.robot_model]: No root/virtual joint specified in SRDF. Assuming fixed joint
[move_group-1] [INFO] [1694012423.865155745] [moveit_kinematics_base.kinematics_base]: Using position only ik
[move_group-1] [INFO] [1694012425.260442551] [moveit_ros.planning_scene_monitor.planning_scene_monitor]: Publishing maintained planning scene on 'monitored_planning_scene'
[move_group-1] [INFO] [1694012425.260720014] [moveit.ros_planning_interface.moveit_cpp]: Listening to 'joint_states' for joint states
[move_group-1] [INFO] [1694012425.262647894] [moveit_ros.current_state_monitor]: Listening to joint states on topic 'joint_states'
[move_group-1] [INFO] [1694012425.263455907] [moveit_ros.planning_scene_monitor.planning_scene_monitor]: Listening to '/attached_collision_object' for attached collision objects
[move_group-1] [INFO] [1694012425.263483366] [moveit_ros.planning_scene_monitor.planning_scene_monitor]: Starting planning scene monitor
[move_group-1] [INFO] [1694012425.264933042] [moveit_ros.planning_scene_monitor.planning_scene_monitor]: Listening to '/planning_scene'
[move_group-1] [INFO] [1694012425.264966412] [moveit_ros.planning_scene_monitor.planning_scene_monitor]: Starting world geometry update monitor for collision objects, attached objects, octomap updates.
[move_group-1] [INFO] [1694012425.265801550] [moveit_ros.planning_scene_monitor.planning_scene_monitor]: Listening to 'collision_object'
[move_group-1] [INFO] [1694012425.266665953] [moveit_ros.planning_scene_monitor.planning_scene_monitor]: Listening to 'planning_scene_world' for planning scene world geometry
[move_group-1] [WARN] [1694012425.267298621] [moveit.ros.occupancy_map_monitor.middleware_handle]: Resolution not specified for Octomap. Assuming resolution = 0.1 instead
[move_group-1] [ERROR] [1694012425.267328149] [moveit.ros.occupancy_map_monitor.middleware_handle]: No 3D sensor plugin(s) defined for octomap updates
[move_group-1] [ERROR] [1694012425.381326649] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
[move_group-1] [ERROR] [1694012425.574183704] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
[move_group-1] [INFO] [1694012427.898257942] [moveit.ros_planning_interface.moveit_cpp]: Loading planning pipeline 'pilz_industrial_motion_planner'
[move_group-1] [ERROR] [1694012427.899235651] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
[move_group-1] [ERROR] [1694012427.899962334] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
[move_group-1] [ERROR] [1694012427.900000829] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
[move_group-1] [ERROR] [1694012427.900025056] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
[move_group-1] [ERROR] [1694012427.900047270] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
[move_group-1] [ERROR] [1694012427.900069015] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
[move_group-1] [ERROR] [1694012427.900110126] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
[move_group-1] [ERROR] [1694012427.900134147] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
[move_group-1] [ERROR] [1694012427.900205442] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
[move_group-1] [ERROR] [1694012427.900238005] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
[move_group-1] [ERROR] [1694012427.900260457] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
[move_group-1] [ERROR] [1694012427.900281975] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
[move_group-1] [ERROR] [1694012427.900303337] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
[move_group-1] [ERROR] [1694012427.900324611] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
[move_group-1] [ERROR] [1694012427.900346972] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
[move_group-1] [INFO] [1694012427.914311507] [moveit.pilz_industrial_motion_planner.joint_limits_aggregator]: Reading limits from namespace robot_description_planning
[move_group-1] [INFO] [1694012427.929095164] [moveit.pilz_industrial_motion_planner]: Available plugins: pilz_industrial_motion_planner/PlanningContextLoaderCIRC pilz_industrial_motion_planner/PlanningContextLoaderLIN pilz_industrial_motion_planner/PlanningContextLoaderPTP
[move_group-1] [INFO] [1694012427.929129872] [moveit.pilz_industrial_motion_planner]: About to load: pilz_industrial_motion_planner/PlanningContextLoaderCIRC
[move_group-1] [INFO] [1694012427.935363709] [moveit.pilz_industrial_motion_planner]: Registered Algorithm [CIRC]
[move_group-1] [INFO] [1694012427.935999212] [moveit.pilz_industrial_motion_planner]: About to load: pilz_industrial_motion_planner/PlanningContextLoaderLIN
[move_group-1] [INFO] [1694012427.938983840] [moveit.pilz_industrial_motion_planner]: Registered Algorithm [LIN]
[move_group-1] [INFO] [1694012427.939539179] [moveit.pilz_industrial_motion_planner]: About to load: pilz_industrial_motion_planner/PlanningContextLoaderPTP
[move_group-1] [INFO] [1694012427.942555583] [moveit.pilz_industrial_motion_planner]: Registered Algorithm [PTP]
[move_group-1] [INFO] [1694012427.943143147] [moveit.ros_planning.planning_pipeline]: Using planning interface 'Pilz Industrial Motion Planner'
[move_group-1] [INFO] [1694012427.949306191] [moveit.ros_planning_interface.moveit_cpp]: Loading planning pipeline 'chomp'
[move_group-1] [ERROR] [1694012427.951833312] [moveit.ros_planning.planning_pipeline]: Exception while loading planner 'chomp_interface/CHOMPPlanner': According to the loaded plugin descriptions the class chomp_interface/CHOMPPlanner with base class type planning_interface::PlannerManager does not exist. Declared types are  ompl_interface/OMPLPlanner pilz_industrial_motion_planner/CommandPlannerAvailable plugins: ompl_interface/OMPLPlanner, pilz_industrial_motion_planner/CommandPlanner
[move_group-1] [INFO] [1694012427.961000062] [moveit_ros.fix_workspace_bounds]: Param 'chomp.default_workspace_bounds' was not set. Using default value: 10.000000
[move_group-1] [INFO] [1694012427.961832365] [moveit_ros.fix_start_state_bounds]: Param 'chomp.start_state_max_bounds_error' was set to 0.100000
[move_group-1] [INFO] [1694012427.962377647] [moveit_ros.fix_start_state_bounds]: Param 'chomp.start_state_max_dt' was not set. Using default value: 0.500000
[move_group-1] [INFO] [1694012427.962963161] [moveit_ros.fix_start_state_collision]: Param 'chomp.start_state_max_dt' was not set. Using default value: 0.500000
[move_group-1] [INFO] [1694012427.963561446] [moveit_ros.fix_start_state_collision]: Param 'chomp.jiggle_fraction' was set to 0.050000
[move_group-1] [INFO] [1694012427.964080448] [moveit_ros.fix_start_state_collision]: Param 'chomp.max_sampling_attempts' was not set. Using default value: 100
[move_group-1] [INFO] [1694012427.964931502] [moveit.ros_planning.planning_pipeline]: Using planning request adapter 'Add Time Parameterization'
[move_group-1] [INFO] [1694012427.965812754] [moveit.ros_planning.planning_pipeline]: Using planning request adapter 'Resolve constraint frames to robot links'
[move_group-1] [INFO] [1694012427.968255337] [moveit.ros_planning.planning_pipeline]: Using planning request adapter 'Fix Workspace Bounds'
[move_group-1] [INFO] [1694012427.968278133] [moveit.ros_planning.planning_pipeline]: Using planning request adapter 'Fix Start State Bounds'
[move_group-1] [INFO] [1694012427.968284304] [moveit.ros_planning.planning_pipeline]: Using planning request adapter 'Fix Start State In Collision'
[move_group-1] [INFO] [1694012427.968290491] [moveit.ros_planning.planning_pipeline]: Using planning request adapter 'Fix Start State Path Constraints'
[move_group-1] [ERROR] [1694012427.978163778] [moveit.ros_planning_interface.moveit_cpp]: Failed to initialize planning pipeline 'chomp'.
[move_group-1] [INFO] [1694012427.984607682] [moveit.ros_planning_interface.moveit_cpp]: Loading planning pipeline 'ompl'
[move_group-1] [ERROR] [1694012428.017916006] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
[move_group-1] [INFO] [1694012428.115319535] [moveit.ros_planning.planning_pipeline]: Using planning interface 'OMPL'
[move_group-1] [INFO] [1694012428.119716411] [moveit_ros.fix_workspace_bounds]: Param 'ompl.default_workspace_bounds' was not set. Using default value: 10.000000
[move_group-1] [INFO] [1694012428.120413441] [moveit_ros.fix_start_state_bounds]: Param 'ompl.start_state_max_bounds_error' was set to 0.100000
[move_group-1] [INFO] [1694012428.120878620] [moveit_ros.fix_start_state_bounds]: Param 'ompl.start_state_max_dt' was not set. Using default value: 0.500000
[move_group-1] [INFO] [1694012428.121226722] [moveit_ros.fix_start_state_collision]: Param 'ompl.start_state_max_dt' was not set. Using default value: 0.500000
[move_group-1] [INFO] [1694012428.121546516] [moveit_ros.fix_start_state_collision]: Param 'ompl.jiggle_fraction' was set to 0.050000
[move_group-1] [INFO] [1694012428.121859004] [moveit_ros.fix_start_state_collision]: Param 'ompl.max_sampling_attempts' was not set. Using default value: 100
[move_group-1] [INFO] [1694012428.122177815] [moveit.ros_planning.planning_pipeline]: Using planning request adapter 'Add Time Parameterization'
[move_group-1] [INFO] [1694012428.122500968] [moveit.ros_planning.planning_pipeline]: Using planning request adapter 'Resolve constraint frames to robot links'
[move_group-1] [INFO] [1694012428.122855972] [moveit.ros_planning.planning_pipeline]: Using planning request adapter 'Fix Workspace Bounds'
[move_group-1] [INFO] [1694012428.123218650] [moveit.ros_planning.planning_pipeline]: Using planning request adapter 'Fix Start State Bounds'
[move_group-1] [INFO] [1694012428.123578251] [moveit.ros_planning.planning_pipeline]: Using planning request adapter 'Fix Start State In Collision'
[move_group-1] [INFO] [1694012428.123946388] [moveit.ros_planning.planning_pipeline]: Using planning request adapter 'Fix Start State Path Constraints'
[move_group-1] [ERROR] [1694012428.191827479] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
[move_group-1] [FATAL] [1694012428.218998432] [moveit_ros.trajectory_execution_manager]: Exception while loading controller manager 'moveit_simple_controller/MoveItSimpleControllerManager': According to the loaded plugin descriptions the class moveit_simple_controller/MoveItSimpleControllerManager with base class type moveit_controller_manager::MoveItControllerManager does not exist. Declared types are  moveit_simple_controller_manager/MoveItSimpleControllerManager
[move_group-1] [ERROR] [1694012428.219724910] [moveit_ros.trajectory_execution_manager]: Failed to reload controllers: `controller_manager_` does not exist.
[move_group-1] [INFO] [1694012428.221761439] [moveit_ros.trajectory_execution_manager]: Trajectory execution is managing controllers
[move_group-1] [INFO] [1694012428.223782146] [move_group.move_group]: MoveGroup debug mode is ON
[move_group-1] [INFO] [1694012428.307856730] [move_group.move_group]:
[move_group-1]
[move_group-1] ********************************************************
[move_group-1] * MoveGroup using:
[move_group-1] *     - ApplyPlanningSceneService
[move_group-1] *     - ClearOctomapService
[move_group-1] *     - CartesianPathService
[move_group-1] *     - ExecuteTrajectoryAction
[move_group-1] *     - GetPlanningSceneService
[move_group-1] *     - KinematicsService
[move_group-1] *     - MoveAction
[move_group-1] *     - MotionPlanService
[move_group-1] *     - QueryPlannersService
[move_group-1] *     - StateValidationService
[move_group-1] ********************************************************
[move_group-1]
[move_group-1] [INFO] [1694012428.308015960] [moveit_move_group_capabilities_base.move_group_context]: MoveGroup context using planning plugin ompl_interface/OMPLPlanner
[move_group-1] [INFO] [1694012428.308038801] [moveit_move_group_capabilities_base.move_group_context]: MoveGroup context initialization complete
[move_group-1] Loading 'move_group/ApplyPlanningSceneService'...
[move_group-1] Loading 'move_group/ClearOctomapService'...
[move_group-1] Loading 'move_group/MoveGroupCartesianPathService'...
[move_group-1] Loading 'move_group/MoveGroupExecuteTrajectoryAction'...
[move_group-1] Loading 'move_group/MoveGroupGetPlanningSceneService'...
[move_group-1] Loading 'move_group/MoveGroupKinematicsService'...
[move_group-1] Loading 'move_group/MoveGroupMoveAction'...
[move_group-1] Loading 'move_group/MoveGroupPlanService'...
[move_group-1] Loading 'move_group/MoveGroupQueryPlannersService'...
[move_group-1] Loading 'move_group/MoveGroupStateValidationService'...
[move_group-1]
[move_group-1] You can start planning now!
[move_group-1]
[move_group-1] [ERROR] [1694012428.345117932] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
[move_group-1] [ERROR] [1694012428.481281894] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
[move_group-1] [ERROR] [1694012428.581690115] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
[move_group-1] [ERROR] [1694012428.690183074] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
[move_group-1] [ERROR] [1694012428.806492246] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
[move_group-1] [ERROR] [1694012428.928206957] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
[move_group-1] [ERROR] [1694012429.069404377] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
[move_group-1] [ERROR] [1694012429.234023061] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
[move_group-1] [ERROR] [1694012429.362592711] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
[move_group-1] [ERROR] [1694012429.495362228] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
[move_group-1] [ERROR] [1694012429.602467505] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
[move_group-1] [ERROR] [1694012429.725921759] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
[move_group-1] [ERROR] [1694012429.856541282] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
[move_group-1] [ERROR] [1694012429.977396568] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
[move_group-1] [ERROR] [1694012430.090659941] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
[move_group-1] [ERROR] [1694012430.203335063] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
[move_group-1] [ERROR] [1694012430.323374128] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
[move_group-1] [ERROR] [1694012430.433809989] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
[move_group-1] [ERROR] [1694012430.549070609] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
[move_group-1] [ERROR] [1694012430.784446826] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
[move_group-1] [ERROR] [1694012430.905078852] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
[move_group-1] [ERROR] [1694012431.018402346] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
[move_group-1] [ERROR] [1694012431.142214877] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
[move_group-1] [ERROR] [1694012431.251748896] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
[move_group-1] [ERROR] [1694012431.365726843] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
[move_group-1] [ERROR] [1694012431.499175785] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
[move_group-1] [ERROR] [1694012431.631390811] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
[move_group-1] [ERROR] [1694012431.752993154] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
[move_group-1] [ERROR] [1694012431.861795521] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
[move_group-1] [ERROR] [1694012431.968442148] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
[move_group-1] [ERROR] [1694012432.092238312] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
[move_group-1] [ERROR] [1694012432.208372721] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
[move_group-1] [ERROR] [1694012432.322000701] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
[move_group-1] [ERROR] [1694012432.442328421] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'
Thanks in Advance Adithya

Explanation:
Your configuration or model is invalid, which prevents MoveIt from using it. This is the specific error:

[move_group-1] [ERROR] [1694012428.345117932] [moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model 'arm_robot'

This is telling us that you are attempting to make use of some joint called joint_5_mimic, but that it is not being provided by the arm_robot model.

As a result, you need to check that that your arm_robot URDF does actually contain this joint. You'll also need to make sure that this joint has been included in the move_group when configured using the MoveIt 2 setup assistant.

$\begingroup$

Your configuration or model is invalid, which prevents MoveIt from using it.
This is the specific error:

` [move_group-1] [ERROR] [1694012428.345117932]
[moveit_robot_model.robot_model]: Joint 'joint_5_mimic' not found in model
'arm_robot' `

This is telling us that you are attempting to make use of some joint called `
joint_5_mimic ` , but that it is not being provided by the ` arm_robot `
model.

As a result, you need to check that that your arm_robot URDF does actually
contain this joint. You'll also need to make sure that this joint has been
included in the move_group when configured using the MoveIt 2 setup assistant
(docs [ here
](https://moveit.picknik.ai/humble/doc/examples/setup_assistant/setup_assistant_tutorial.html)
).

* * *

Edit since you've added this information:

> I mimic joint 4 in the opposite direction to perform a grasp using a gripper
> in my robot model

It is unusual to do this in MoveIt (and actually I'm not sure if treating
joints this way is fully supported, but don't quote me on that). The more
typical approach would be to have the move group handle _just_ the arm, and
then the gripper is a standalone end-effector that MoveIt doesn't need to
provide plans for directly. It'll still need to know the collisions, etc, but
it won't be responsible for handling the inverse kinematics of the gripper.

So with that in mind, my recommendation would be to

  * remove the gripper from the move group
  * provide the ability to open/close the gripper using some other functionality (take a look at the [ Robotiq grippers ](https://github.com/ros-industrial/robotiq) for a better demonstration of this)
  * Perform kinematic planning using MoveIt and then open/close gripper as a standalone process that is not handled kinematically.


Question:
Controlling Arduino device from ROS node

How can a motor control node (which will subscribe to the cmd_vel topic) be linked to my robot hardware?

My first idea is to communicate via byte signal like

|0000|0000|0000|0000|0000|

as

|ID|Motor_1|Motor_2|Motor_3|Motor_4|

Arduino will be used as the low level hardware control, and receive the signal and information via byte using a nrf240L1 module. Would this work?

Explanation: We may use rosserial protocol for wrapping standard ROS serialized messages before sending.

$\begingroup$

You can use [ rosserial ](http://wiki.ros.org/rosserial) for sending commands
over the Serial port to your Arduino.

> |0000|0000|0000|0000|0000| as |ID|Motor_1|Motor_2|Motor_3|Motor_4|

This is called a **dataframe** . If you do end up using Serial transports, you
would have to design your own dataframe. What you have should work, but do
keep in mind your requirements. If the arduino is responsible for sending over
some information about each motor encoder, you should adapt your dataframe to
include this information as well. Also, you should think about using some
start and end flags _(could be a sequence or a particular number)_ that will
help you to know when a new transmission has arrived, and when the current
transmission has ended.

**EDIT:** I looked at the [ nRF240L1
](https://www.elprocus.com/nrf24l01/#:%7E:text=NRF24L01%20is%20a%20radio%20transceiver,crystal%20oscillator%20modulator%2C%20and%20demodulator.)
module you were talking about, and turns out it uses an SPI-based
communication interface. In this case, your arduino would act as a bridge,
which takes in data passed in via Serial , and sends the appropriate SPI
commands over to the particular transceiver.


Question:
How to add a header with timestamp to numpy_msg?

I am using the rospy with numpy tutorial to create a publisher and subscriber that send numpy arrays to listener that uses an ApproximateTimeSynchronizer. However, I receive an error when I try to instantiate the listener:

[WARN] [1693265081.824595]: Cannot use message filters with non-stamped messages. Use the 'allow_headerless' constructor option to auto-assign ROS time to headerless messages.
So my understanding is that my message must contain a header with a time stamp. Is it possible to add a header with a timestamp to a numpy_msg? And if so, how do I this?

My message publisher construction:

from rospy_tutorials.msg import Floats
from rospy.numpy_msg import numpy_msg

l_lines_pub = rospy.Publisher('/l_lines_output', numpy_msg(Floats), queue_size=10)
r_lines_pub = rospy.Publisher('/r_lines_output', numpy_msg(Floats), queue_size=10)

l_lines_msg = np.asarray(ARRAY1)
r_lines_msg = np.asarray(ARRAY2)

l_lines_pub.publish(l_lines_msg)
r_lines_pub.publish(r_lines_msg)
And my subscriber looks like:

l_lines_sub = Subscriber('/l_lines_output', numpy_msg(Floats))
r_lines_sub = Subscriber('/r_lines_output', numpy_msg(Floats))

ats = ApproximateTimeSynchronizer([l_lines_sub, r_lines_sub], queue_size=5, slop=0.015)
ats.registerCallback(gotData)
Thanks!

Explanation: We need to check the code and examples of numpy_msg, and see how to implement the header with a timestamp.

$\begingroup$

> Is it possible to add a header with a timestamp to a ` numpy_msg `

In short, yes, I think you just need to call ` numpy_msg() ` on a stamped
message.

` numpy_msg() ` isn't a message type, it's a conversion function that creates
and returns a new type based on an existing ROS message type, see [ here
](https://github.com/ros/ros_comm/blob/noetic-
devel/clients/rospy/src/rospy/numpy_msg.py#L83) .

I have not used this myself, but it looks to me like it should work with any
ROS message type that implements ` serialize_numpy ` and ` deserialize_numpy `
methods (see [ here ](https://github.com/ros/ros_comm/blob/noetic-
devel/clients/rospy/src/rospy/numpy_msg.py#L87) ). Furthermore, it appears
that these two methods are auto-generated by the message generation system,
and so I think you can call ` numpy_msg() ` on any ROS message, built-in or
custom, including messages that include headers.

There's some more information here:

[ https://ros-users.narkive.com/2VzlEDxg/fast-methods-to-go-between-ros-
pointcloud-and-numpy ](https://ros-users.narkive.com/2VzlEDxg/fast-methods-to-
go-between-ros-pointcloud-and-numpy)

As far as I can tell you should be able to simply replace your `
rospy_tutorials/Floats ` message with a suitable existing message or your own
[ custom message
](http://wiki.ros.org/ROS/Tutorials/CreatingMsgAndSrv#Using_msg) that includes
a header and a floating point array type.

The use of generic numeric arrays to pass data is discouraged, as discussed
here: [ Stamped std_msgs
](https://robotics.stackexchange.com/questions/31038/stamped-std-msgs) , so as
far as I know there's no built-in stamped generic floating-point array. You
could define one, but it'd be better to define a message where the array has a
meaningful name.

Curiously, the Numpy serialization and deserialization code for many built-in
messages doesn't actually use Numpy, I think because a philosophy of
meaningful, well-named fields tends to favor single floating-point numbers
with individual names.

I found [ ` sensor_msgs/LaserScan `
](https://docs.ros.org/en/noetic/api/sensor_msgs/html/msg/LaserScan.html) as
one example of a stamped message that does contain array fields. Corresponding
(old) autogenerated Python code for that message is [ here
](http://docs.ros.org/en/diamondback/api/sensor_msgs/html/__LaserScan_8py_source.html#l00213)
. This code uses ` ndarray.tostring() ` and ` numpy.frombuffer() ` for
serialization and deserialization of the ` ranges ` and ` intensities `
fields.

A similar simpler message with a ` Header ` and a ` float32[] ` or ` float64[]
` array should work with ` numpy_msg() ` and give you the timestamp you need.

> listener that uses an ` ApproximateTimeSynchronizer ` . However, I receive
> an error when I try to instantiate the listener

Depending on what you're trying to accomplish, maybe you don't need accurate
timestamps from the publisher. Then I think you could also try:

    ats = ApproximateTimeSynchronizer(
          [l_lines_sub, r_lines_sub],
          queue_size=5, slop=0.015, allow_headerless=True)

From [ the ` message_filters ` wiki
](http://wiki.ros.org/message_filters#ApproximateTime_Policy) :

> If some messages are of a type that doesn't contain the header field, `
> ApproximateTimeSynchronizer ` refuses by default adding such messages.
> However, its Python version can be constructed with ` allow_headerless=True
> ` , which uses current ROS time in place of any missing ` header.stamp `
> field


Question:
How to ensure colcon does not run doxygen

I noticed upon building Gazebo Garden that it runs doxygen. This takes a significant time. Is there a way to disable this?

Explanation: doxygen is related to documentation generation. We need to find a method/flag to disable documentation.

$\begingroup$

This is not a ` colcon ` option, but Gazebo libraries have a cmake flag for
disabling documentation. You'd pass it through colcon via ` --cmake-args
-DBUILD_DOCS=OFF ` . [ This ](https://github.com/gazebosim/gz-cmake/blob/gz-
cmake3/tutorials/developing_with_gz-cmake.md) is a good tutorial to look
through for this and other flags.


Question:
Rosdep installing python dependencies as root seems to break the installation

I started with ROS2 for robotic development. As far as I understand one must specify the dependencies of the code in package.xml (for example all python imports) and rosdep will install these dependencies for you using sudo. Pip warns against this type of install saying that the installation may break.

I use modules from Adafruit-Blinka (board). Blinka is specified in the <exec-depend> tag and it is recognized (it is in python.yaml). Rosdep install Adafruit-Blinka as root. Next I run the code and as soon as board is imported the code crashes with the following error: Module not found: 'hid' (full error message at the end).

I can reproduce this problem with a simple python program containing one line: import board. It crashes in the same way as the ros program (Module not found: 'hid'). When I first sudo pip uninstall Adafruit-Blinka and next pip install Adafruit_Blinka (without sudo), I can import board without problems.

Is it correct to assume that a sudo pip install causes module 'hid' not to be found? If so, is there a workaround so that rosdep does not install the modules as root?

Full error message:

$ ros2 run sensor_vl53l1x talker
Traceback (most recent call last):
  File "/media/i-files/home/arnold/development/ros2/bottie/install/sensor_vl53l1x/lib/sensor_vl53l1x/talker", line 33, in <module>
    sys.exit(load_entry_point('sensor-vl53l1x==0.0.0', 'console_scripts', 'talker')())
  File "/media/i-files/home/arnold/development/ros2/bottie/install/sensor_vl53l1x/lib/sensor_vl53l1x/talker", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 171, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/media/i-files/home/arnold/development/ros2/bottie/install/sensor_vl53l1x/lib/python3.10/site-packages/sensor_vl53l1x/vl53l1x_publisher.py", line 5, in <module>
    import board
  File "/usr/local/lib/python3.10/dist-packages/board.py", line 22, in <module>
    from adafruit_blinka.agnostic import board_id, detector
  File "/usr/local/lib/python3.10/dist-packages/adafruit_blinka/agnostic/__init__.py", line 21, in <module>
    chip_id = detector.chip.id
  File "/usr/local/lib/python3.10/dist-packages/adafruit_platformdetect/chip.py", line 90, in id
    import hid
ModuleNotFoundError: No module named 'hid'
[ros2run]: Process exited with failure 1

Explanation: This is related to rosdep installation. We may ask it to not do that for certain installers.

$\begingroup$

I should have added ` --as-root pip:false ` as an extra argument to rosdep.
This is described at [ github ](https://github.com/ros2/ros2/issues/1478) .


Question:
E: Unable to locate package ros-galactic-ros-gz

I am trying to install (ignition) Gazebo Edifice on my Ubuntu 20.04 system which already has ROS2 Galactic installed on it.

I'm using the command sudo apt-get install ros-galactic-ros-gz as mentioned here. But apt says it's not able to find the binaries as shown below. enter image description here

How should I go about this?

Explanation: We need to check the installation of galactic package, and may also try other versions.

$\begingroup$

Found on galactic branch of the [ ros_gz github repo
](https://github.com/gazebosim/ros_gz/tree/galactic) that I've to install
using ` sudo apt install ros-galactic-ros-ign `


Question:
Gazebo ignition (garden/fortress) attaching model to arm

I'm trying to attach a moving object with inertia to a robotic arm. I saw that there are plugins for detaching joints but is there a way to do the opposite and attach one model to another via a joint? preferably it would maintain its velocity and angular velocity till acted on by the arm. If not, then could 2 separate SDF models be designed one with the model attached, then swap one model for the other during simulation?

Explanation: The detachable joint plugin can also attach two models (specifically, links from two different models) together with a fixed joint. We can check an example of how that's done in code.

$\begingroup$

The detachable joint plugin can also attach two models (specifically, links
from two different models) together with a fixed joint. Here's [ an example
](https://github.com/osrf/mbzirc/blob/ec66f35c1fc925f18565c03251bd5f12f5b6b4e3/mbzirc_ign/src/SuctionGripper.cc#L278-L283)
of how that's done in code


Question:
How to build a python node as a component?

I have a python node that I would like to add to a composable node container.

I could not find any documentation on the python equivalent to the rclcpp_components_register_node cmake command. I would assume that I would need to adjust the python code of the node as well as the setup.py file.

Naively, I have just tried to add the executable in the ComposableNode():

ComposableNode(
    package="foo",
    plugin="foo_node",
    name="foo",
),
but got the following error when launching:

[ERROR] [bar.container]: Could not find requested resource in ament index
[ERROR] [launch_ros.actions.load_composable_nodes]: Failed to load node 'foo_node' of type 'foo_node' in container '/bar/container': Could not find requested resource in ament index
It would be great if you could help me figure this out. Thanks.

Explanation: We may check the feature status about whether the functionality is supported in python.

$\begingroup$

Welcome to Robotics Stack Exchange!

> How to build a python node as a component?

As of ROS 2 Iron Irwinin [ the features status
](https://docs.ros.org/en/rolling/The-ROS2-Project/Features.html) mentions
that the composition of node components at compile, link, load, or run time is
currently only in C++.


Question:
Path and trajectory planning for a holonomic drivetrain with non zero starting velocities

What path planning algorithms are typically used for holonomic drivetrains that can avoid collisions while also starting with non zero velocities. I am working on a project where I am planning to have a robot avoid common household objects, drive around them, but do so in a way that it can be on the fly may result in the robot having a non zero starting velocity. I have looked into A* and that could work when using cubic or quintic splines as that could account for the current velocity, but when accounting for more sophisticated object avoidance using something like rrt, I am unsure as to how that would work with a non zero starting velocity. Thank you!

Explanation: One suitable method might be real-time RRT* (RT-RRT*). It's designed to solve exactly the problem you have - plan and update paths that can change as the path is traversed.

$\begingroup$

One suitable method might be [ real-time RRT*
](https://users.aalto.fi/%7Ehamalap5/FutureGameAnimation/p113-naderi.pdf) (RT-
RRT*). It's designed to solve exactly the problem you have - plan and update
paths that can change as the path is traversed. One word of warning - the
update procedure requires the current node traversal to complete before
switching to the newly updated path. In other words, while moving from node
$v_{1}$  to  $v_{2}$  , the algorithm cannot avoid dynamic obstacles that
suddenly show up between these two points. In practice this likely shouldn't
be a big problem as long as your nodes are close enough together and you are
using an efficient implementation of RT-RRT*

If you decide to implement this method yourself, [ this
](https://github.com/nmslib/hnswlib) hierarchical navigable small worlds
(HNSW) library provides a very efficient method for performing approximate
nearest neighbor searches. Given that this is one of the more difficult tasks
in RRT-based algorithms to handle efficiently (especially as tree sizes grow),
this should help out quite a bit.


Question:
How is TF2 supposed to be set up for an Ackerman steering robot with Navigation2

Hello, I am currently working with a physical, ackermann steering robot (car like). Right now my TF is setup with base_link on the ground between the two rear wheels. However, I notice strange behavior with navigation2, including trying to steer but not move. I then wondered whether my tf is setup correctly, maybe I need to give navigation 2 a link at the center of my robot, or between the two front wheels ? I didn't find anything online so I think it would be great to have something detailed on it. In navigation2 I use a MPPI controller with Reeds_Shepp motion model, the path seems to be correctly generated and every link in the parameters is setup to base_link. Also, base_link is setup as X forward,Y on the left and Z up, and I work on Humble. I hope someone will be able to help me, tell me if you need more info and I'll try to give them as fast as possible !

Explanation: We may check the definition of the coordinate frames for mobile platforms to see whether this is correct.

$\begingroup$

![Rosanswers logo](https://i.sstatic.net/yuGTR.png)

The coordinate frames for mobile platforms are defined in [ REP 105
](https://www.ros.org/reps/rep-0105.html) including ` base_link ` . Which you
appear to be following correctly. The most common location on ackermann
vehicles is the center of the rear axle.

I don't think that the problem that you're having is related to your
coordinate frames.

* * *

Originally posted by [ tfoote ](https://answers.ros.org/users/3/tfoote/) with
karma: 58457 on 2023-07-27

This answer was **ACCEPTED** on the original site

Post score: 1

* * *

###  Original comments

**Comment by[ Timothée ](https://answers.ros.org/users/148408/timoth%C3%A9e/)
on 2023-07-31 ** :
You are perfectly right, my problem was a combination of bad settings for my
controller, and my node controlling the wheels not turning at the right speed
so my robot could not follow the path. Now it does work well, without any
changes in the tf tree.


Question:
How to add to the library search path for custom plugins

Gazebo Answers logo

Hi,

I'm running a gz-sim (Garden) simulation starting from PX4 where I want to include a custom plugin into my model. The model works if I copy-paste the .so file to any of the default search locations, i.e.

- /home/anton/.gz/sim/plugins/
- /usr/lib/x86_64-linux-gnu/gz-sim-7/plugins/
- /home/anton/.ignition/gazebo/plugins/
However, I'd prefer to set an environment variable (as in Gazebo-Classic) to tell gazebo to search for additional plugins. In gazebo-classic I could do

export GAZEBO_PLUGIN_PATH="$PWD:$GAZEBO_PLUGIN_PATH"
but this doesn't seem to work in gz-sim garden.

Is there any other way to add to the library search path of gz-sim?

Explanation: The problem may lie in the incorrect environment variable names. We need to check its correct spelling.

$\begingroup$

![Gazebo Answers logo](https://i.sstatic.net/Ze9EC.jpg)

Found the answer myself. The new path variable is

    GZ_SIM_SYSTEM_PLUGIN_PATH

The best overview I found of the naming conventions in the ` gz-garden ` is in
this [ presentation
](https://docs.google.com/presentation/d/1VP7h1jirRdJpM0BsV42RgXsMPeDE6D7ePV1Mg1jch-U)
.

* * *

Originally posted by [ antbre
](https://answers.gazebosim.org/users/60527/antbre/) with karma: 1 on
2023-07-13

This answer was **ACCEPTED** on the original site

Post score: 0

* * *

###  Original comments

**Comment by[ mz ](https://answers.gazebosim.org/users/2327/mz/) on 2023-07-14
** :
Hi, thanks for looking over the presentation. For others, the variable can be
found by ` gz sim --help ` . Also, that variable is documented in a tutorial
for how to find resources [ https://gazebosim.org/api/sim/7/resources.html
](https://gazebosim.org/api/sim/7/resources.html)


Question:
Add files to be loaded when ROS node is launched

Rosanswers logo

Hello ROS community,

I have a python code for a hardware device (radar) that uses a parameters.cfg file for hardware settings (independantly of ROS).

In the same code, I am creating a ROS node so that the device publishes its collected data.

When I use a launch file, the basic format is as follows :

<launch>
 <node pkg="radar_uart"
    name="radar"
    type="radar.py"
    output="screen">
 </node>
</launch>
But when I do my $roslaunch radar radar.launch command, I get the error that it could not find the config file : [ No such file or directory 'radar_config30hz.cfg' ]

I tested by adding this line to the launch file, so the config would be loaded when launching the node :

<rosparam file="$(find radar)/src/radar_config30hz.cfg" command="load"/>
It is still not working and the new error is : [ Ressource not found: your_package_name ]

PS : As said the file is a not a dynamic reconfigure file, it just contains parameters to be used by the radar Hardware.

Please enlighten me on how to simly make the ros node find the file and use it when it launches.

Thanks and regards,

Lilia

Explanation: The error with the No such file or directory could be due to the fact that you are giving a relative path for radar_config30hz.cfg, assuming that the working directory of your node will be the one in which the .py file is. Be aware that this may not be the case. We need to check packages that can obtain absolute path in python.

$\begingroup$

![Rosanswers logo](https://i.sstatic.net/yuGTR.png)

Hi!

The error with the **No such file or directory** could be due to the fact that
you are giving a relative path for ` radar_config30hz.cfg ` , assuming that
the working directory of your node will be the one in which the ` .py ` file
is. Be aware that this is not the case unless you specify it with the [ ` cwd
` attribute ](https://wiki.ros.org/roslaunch/XML/node) on launch. Find below
some possible solutions:

  * From inside your Python script, get the location of the ROS package [ with ` rospack ` ](https://wiki.ros.org/Packages#Client_Library_Support) and specify the absolute path to the ` .cfg ` file. This is what I would personally do.
  * From inside your Python script, get the location of the Python file by following [ these instructions ](https://stackoverflow.com/questions/3430372/how-do-i-get-the-full-path-of-the-current-files-directory) and specify the absolute path to the ` .cfg ` file
  * Specify the working directory to be the one where your ` .cfg ` file lies with the ` cwd ` argument in the launch file.

As for the **Resource not found** error, from what you have written, the error
is simply that your package name is ` radar_uart ` , but then you ask ROS to `
find radar ` instead.

* * *

Originally posted by [ bluegiraffe-sc
](https://answers.ros.org/users/69377/bluegiraffe-sc/) with karma: 221 on
2023-07-10

This answer was **ACCEPTED** on the original site

Post score: 0

* * *

###  Original comments

**Comment by[ Lilipop ](https://answers.ros.org/users/149103/lilipop/) on
2023-07-11 ** :
Hello,

Thanks for the answer, effectively I was giving a path related to my src
directory before doing the catkin_make, I looked for the ROS package and added
the cfg file then modified the path based on its location in the ROS package.

Thanks a lot :)

**Comment by[ bluegiraffe-sc
](https://answers.ros.org/users/69377/bluegiraffe-sc/) on 2023-07-11 ** :
Glad it helped!

A minor piece of advice on the use of ROS Answers: the message you have just
posted, should have been a comment to my previous answer, rather than an
answer itself. Sorry for being so pedantic!