icub-tech-iit / ergocub-gazebo-simulations

Repository containing the models and the simulations for ergoCub
BSD 3-Clause "New" or "Revised" License
4 stars 0 forks source link

ros topics for stickbot #28

Open SimoneMic opened 2 years ago

SimoneMic commented 2 years ago

aggiunti file per esporre su ROS i topic di lidar, camera e joint_states

SimoneMic commented 2 years ago

Hi!

  1. If you are referring to alljoints-mc_remapper.xml and alljoints-mc_ros_nws.xml, the first is a remapper for all the joints, needed by the second, to have all the joint data in an unique vector. This because the _robot_statepublisher used in ROS needs a vector with all the joints names, positions and speeds present in the urdf file for computing the TFs. alljoints-mc_ros_nws.xml prepares the data in "ROS" format -i.e. sensor_msgs/JointState.msg, and publishes it in a ROS topic /joint_states. I've taken the naming convention from R1, feel free to change it to a more fitting term.
  2. If roscore is not running the robot will load properly, those devices will simply not work: If I launch a simple yarpserver --write in a terminal and in another terminal: export YARP_CLOCK=/clock gazebo -slibgazebo_yarp_clock.so The robot will still load properly, returning in the console : [INFO] startup phase finished. with all the devices attached. However, they will not work (the ROS ones). Then if I ask for yarp name list in another terminal I will still see the ROS ports, like: registration name /rangefinder_ros_node ip 10.240.0.40 port 10034 type tcp registration name /scan+@/rangefinder_ros_node ip 10.240.0.40 port 10035 type tcp for the lidar.

Maybe @randaz81 can give a more detailed explanation, or correct me.

Nicogene commented 2 years ago

If you are referring to alljoints-mc_remapper.xml and alljoints-mc_ros_nws.xml, the first is a remapper for all the joints, needed by the second, to have all the joint data in an unique vector. This because the robot_state_publisher used in ROS needs a vector with all the joints names, positions and speeds present in the urdf file for computing the TFs. alljoints-mc_ros_nws.xml prepares the data in "ROS" format -i.e. sensor_msgs/JointState.msg, and publishes it in a ROS topic /joint_states. I've taken the naming convention from R1, feel free to change it to a more fitting term.

I would keep the naming convention according to the other XML we have, I would call them gazebo_icub_head_mc_remapper.xml and gazebo_icub_head_mc_nws_ros.xml but it is a minor issue.

If roscore is not running the robot will load properly, those devices will simply not work: If I launch a simple yarpserver --write in a terminal and in another terminal: export YARP_CLOCK=/clock gazebo -slibgazebo_yarp_clock.so The robot will still load properly, returning in the console : [INFO] startup phase finished. with all the devices attached. However, they will not work (the ROS ones). Then if I ask for yarp name list in another terminal I will still see the ROS ports, like: registration name /rangefinder_ros_node ip 10.240.0.40 port 10034 type tcp registration name /scan+@/rangefinder_ros_node ip 10.240.0.40 port 10035 type tcp for the lidar.

Great!

traversaro commented 2 years ago

I think that it is important to keep compatibility between stickbot and future ergocub simulated/real models, to ensure that software that run with one can easily run with the other. No action may be necessary for this PR, but I would open an issue to make sure that this change is aligned with ergocub real robot in the future.