-
Notifications
You must be signed in to change notification settings - Fork 68
BuildROS2
moved to https://dvrk.readthedocs.io
By default, ROS2 broadcasts messages based on your network mask settings. If you have multiple computers on the same subnet/mask, they will all share the same "space" by default. So if you start 2 instances of the dVRK console they will use the same topics, services, tf names... This is a bit dangerous as you might be controlling someone else's robot by accident. There are multiple ways to handle this but here are two simple solutions that should cover most cases:
- All your ROS node will be on the same computer and nobody else has nodes running on the same computer, use the local host only approach
- Your nodes might be spread on multiple computers or there's a chance another user has ROS nodes on any of the computers you're using, domain ID will work (as long as no one uses the same ID)
⚠️ If you use any of the methods below and need to test the results, make sure you stop and restart the ROS 2 daemon after yourexport
/unset
since it will cache some of the discovery information:ros2 daemon stop; ros2 daemon start
You can set a unique ROS Domain ID , either in your own ~/.profile
or for all users with /etc/profile.d/ros2.sh
.
export ROS_LOCALHOST_ONLY=1
Note that the variable ROS_LOCALHOST_ONLY
just has to be defined. Setting it to 0
doesn't turn this feature off, you would have to use unset
to disable the local host only broadcast.
You can set a unique ROS Domain ID , either in your own ~/.profile
or for all users with /etc/profile.d/ros2.sh
.
export ROS_DOMAIN_ID=33
If your organization uses a centralized authentication server (SSO), one can use the Unix user ID to define the ROS Domain ID. Unfortunately the domain ID should be between 0 and 101 (see ROS_DOMAIN_ID) so we can't use the full Unix user Id To automatically set the ROS Domain ID. The following configuration file will generate the domain ID based on the last 2 digits of the user ID. Create or edit the file /etc/profile.d/ros2.sh
to contain:
# set domain id based on last 2 digits of user id
export ROS_DOMAIN_ID=$(id -u | rev | cut -c 1-2 | rev)
ros2 node list
to check nobody is using your domain.
- Terminal 1: starting the dVRK main console
- with a real system:
source ~/ros2_ws/install/setup.bash cd ~/ros2_ws/install/dvrk_config_jhu # we assume each group has created their own configuration file repository! ros2 run dvrk_robot dvrk_console_json -j share/jhu-dVRK-Si/console-PSM1.json
- with a simulated arm:
source ~/ros2_ws/install/setup.bash cd ~/ros2_ws/install/sawIntuitiveResearchKitAll/share/sawIntuitiveResearchKit ros2 run dvrk_robot dvrk_console_json -j share/console/console-PSM1_KIN_SIMULATED.json
- with a real system:
- Terminal 2: using a Python test script to make the arm move
source ~/ros2_ws/install/setup.bash ros2 run dvrk_python dvrk_arm_test.py -a PSM1
- Terminal 3: starting the ROS 2 joint and robot state publishers so we can visualize the arm in RViz
source ~/ros2_ws/install/setup.bash ros2 launch dvrk_model dvrk_state_publisher.launch.py arm:=PSM1
- Terminal 4: starting RViz
source ~/ros2_ws/install/setup.bash ros2 run rviz2 rviz2 -d ~/ros2_ws/install/dvrk_model/share/dvrk_model/rviz/PSM1.rviz
Note that all the configuration files are installed in the ros2_ws/install
directory during the build so you can automatically locate them when you write your own ROS launch files.
- tf2 to pdf:
ros2 run tf2_tools view_frames
(thenevince frames.pdf
to view)
Community
Getting Started
- First Steps
- Software installation
- Controller Connectivity
- Configuration files
- Hardware Setup
- Calibration
- Classic/Standard
- Si
- Examples
Advanced
- Software Architecture
- Application Development
- APIs
- UI Customization
- Teleoperation
- Kinematics Simulation
- Potentiometer Issues
- Development Branches
- Release Checklist
- Projects
- Controllers/versions
- E-STOP Wiring
- Full da Vinci System
- Head Sensor
- Foot Pedals
- Video
- Instruments
Miscellaneous
- Frequently Asked Questions
- User manuals Classic and Si moved
- QLA Heat Sink
- Build w/o ROS Linux Mac
- cisst
- JHU
Deprecated