Saravanan666/pypi-org huggingface dataset:
Package: ros2bagcut
ros2bagcutA tool that simply cuts rosbag files within a specified start and end date and time.1. Install ROS2DISTRO=humble

sudoaptupdate&&sudoaptinstall-ylocales
sudolocale-genen_USen_US.UTF-8
sudoupdate-localeLC_ALL=en_US.UTF-8LANG=en_US.UTF-8exportLANG=en_US.UTF-8

sudoaptinstallsoftware-properties-common
sudoadd-apt-repositoryuniverse

sudoaptupdate&&sudoaptinstallcurl-y
sudocurl-sSLhttps://raw.githubusercontent.com/ros/rosdistro/master/ros.key\-o/usr/share/keyrings/ros-archive-keyring.gpgecho"deb [arch=$(dpkg--print-architecture)signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu$(./etc/os-release&&echo$UBUNTU_CODENAME)main"|sudotee/etc/apt/sources.list.d/ros2.list>/dev/null
sudoaptupdate
sudoaptinstall-yros-${DISTRO}-rosbag22. Install ros2bagcutpipinstallros2bagcut3. Usageros2bagcut \
-i rosbag2_2024_01_12-09_37_34_0.db3 \
-o rosbag2_2024_01_12-09_37_34_0_cut.db3 \
-st 2024 1 12 18 37 55 \
-tz Asia/Tokyousage: ros2bagcut
[-h]
[-i INPUT_BAG_FILE]
[-o OUTPUT_BAG_FILE]
[-st STARTTIME STARTTIME STARTTIME STARTTIME STARTTIME STARTTIME]
[-et ENDTIME ENDTIME ENDTIME ENDTIME ENDTIME ENDTIME]
[-tz {
  Africa/Abidjan
  Africa/Accra
  Africa/Addis_Ababa
  Africa/Algiers
  Africa/Asmara
  ...
  America/Adak
  America/Anchorage
  America/Anguilla
  ...
  Asia/Aden
  Asia/Almaty
  Asia/Amman
  Asia/Anadyr
  Asia/Aqtau
  Asia/Tokyo
  ...
  Europe/Amsterdam
  Europe/Andorra
  Europe/Astrakhan
  Europe/Athens
  Europe/Belgrade
  ...
  Pacific/Apia
  Pacific/Auckland
  Pacific/Bougainville
  ...
}]

options:
  -h, --help
    show this help message and exit
  -i INPUT_BAG_FILE, --input_bag_file INPUT_BAG_FILE
    Input bag file name.
  -o OUTPUT_BAG_FILE, --output_bag_file OUTPUT_BAG_FILE
    Output bag file name.
  -st STARTTIME STARTTIME STARTTIME STARTTIME STARTTIME STARTTIME, \
      --starttime STARTTIME STARTTIME STARTTIME STARTTIME STARTTIME STARTTIME
    Cut start time and date, minute, second.
    If not specified, start from the beginning.
    e.g. --starttime {year} {mont} {day} {hour} {minute} {second}
  -et ENDTIME ENDTIME ENDTIME ENDTIME ENDTIME ENDTIME, \
      --endtime ENDTIME ENDTIME ENDTIME ENDTIME ENDTIME ENDTIME
    Cut end time and date, minute, second.
    If unspecified, to the end.
    e.g. --endtime {year} {mont} {day} {hour} {minute} {second}
  -tz {...}, --timezone {...}
    Time zone string.
Package: ros2dev
ros2devThis project builds a ROS 2.0 development environment in Docker. The user can
then step into the ROS 2.0 environment to perform additional ROS 2.0 actions
(build, rostopic list, etc.).Basic SetupGenerate the Dockerfiles to build the base ROS 2.0 environment:$ ros2dev generateThe generated files are placed in the./generateddirectory by
default. Along with the generatedDockerfileanddocker-compose.ymlfiles is aconfig.jsonfile, which contains cached variables from thegeneratestep.Build the Docker image for the base ROS 2.0 environment:$ ros2dev buildStep into the base ROS 2.0 environment:$ ros2dev envRun a single command in the ROS 2.0 environment:$ ros2dev run -c "ros2 topic list"Install Additional DependenciesSince jinja2 is used to generate the Dockerfiles, a developer can extend the
base Dockerfile by overriding the “third_party” block. An example is provided
in this package at: ./src/ros2dev/templates/third_party.example. To generate a
Dockerfile with an override, use the following command:$ ros2dev generate -o ./src/ros2dev/templates/third_party.exampleThen build the docker image:$ ros2dev buildBuild a ROS 2.0 WorkspaceTo build a ROS 2.0 development environment for a ROS workspace, navigate to the
workspace root directory and run the following command:$ ros2dev generate -w ./src -o ./third_party.dockerfileBy convention, there should be asrcdirectory in the root of a ROS
workspace, so we pass the path to thesrcdirectory to the-w(--ws_copy_dir) option. In this example, we are also using the override
option (-o) to install additional dependencies before building the ROS
workspace.Now you can build the docker image for the ROS environment and step into the
ROS environment:$ ros2dev build
$ ros2dev envNews0.2a1Release date: UNRELEASEDExample news entry for the in-development version0.1Release date: 15-Mar-2010Example news entry for a released version
Package: ros2-msg-transform
ros2_msg_conversionsImplements ros2 message conversion operations.MethodsConvert ROS2 structures to OrderedDictCan be used to convert any type of ROS2 communication structure
(Topic Message, Service, Action).defros2_msg_to_dict(msg:Any)->OrderedDict:"""ros2_msg_to_dict.Converts a ROS2 communication message to an OrderedDict.Args:msg: ROS2 Message to transform. Can be one of type:- Topic Message (Message)- Service Request Message (Service.Request)- Service Response Message (Service.Response)- Action Goal Message (Action.Goal)- Action Cancel Message (Action.Cancel)- Action Result Message (Action.Result)- Action Status Message (Action.Status)- Action Feedback Message (Action.Feedback)"""Below are two examples, one for converting a ROS2 msg and one for converting
a ROS2 srv into an OrderedDict.fromsensor_msgs.msgimportRangemsg=Range()_dict=ros2_msg_to_dict(msg)fromstd_srvs.srvimportSetBoolreq=SetBool.Request()_dict=ros2_msg_to_dict(req)Convert an OrderedDict to a ROS2 communication structureCan be used to convert into any type of ROS2 communication structure
(Topic Message, Service, Action).defdict_to_ros2_msg(py_dict:OrderedDict,msg_cls:Any)->Any:"""dict_to_ros2_msg.Converts a dict/OrderedDict into a ROS2 message, given the message clsas input.Args:py_dict (OrderedDict): Dict/OrderedDict to convert to ROS2 message.msg_cls (Any): ROS2 Message class.- Topic Message (Message)- Service Request Message (Service.Request)- Service Response Message (Service.Response)- Action Goal Message (Action.Goal)- Action Cancel Message (Action.Cancel)- Action Result Message (Action.Result)- Action Status Message (Action.Status)- Action Feedback Message (Action.Feedback)"""Below are two examples, one for converting a ROS2 msg and one for converting
a ROS2 srv into an OrderedDict.fromsensor_msgs.msgimportRange_dict={'range':10.0,'min_range':0.2,'max_range':240.0,'field_of_view':60.0,'radiation_type':0,}_msg=dict_to_ros2_msg(_dict,Range)fromstd_srvs.srvimportSetBool..._req=dict_to_ros2_msg(_dict,SetBool.Request)_resp=dict_to_ros2_msg(_dict,SetBool.Response)You can also construct from and to ROS2 message structures without the need
to import them. This is achieved via passing a string that includes the
namespace of the message._msg = dict_to_ros2_msg_from_ns(_dict, 'sensor_msgs/Range')_msg = dict_to_ros2_srv_from_ns(_dict, 'std_srvs/SetBool.Request')
Package: ros2-numpy
ros2_numpyNote: This is the same as the original ros_numpy package by eric-wieser and ros2_numpy package by box-robotics just edited to be OS independent and installable using pip.Pointcloud manipulation is updatedros2_numpy.pointcloud2to be compatible with ROS2. It now gives a structured numpy array with the fieldsx,y,z,rgb,intensity. Thergbfield is a 3-tuple of uint8 values. Theintensityfield is a float32 value. Thex,y,zfields are float32 values.This project is a fork ofros2_numpyto work with ROS 2. It provides tools for converting ROS messages to and from numpy arrays. In the ROS 2 port, the module has been renamed toros2_numpy. Users are encouraged to update their application code to import
the module as shown below.pip install ros2-numpy
import ros2_numpy as rnpPrefacing your calls likernp.numpify(...)orrnp.msgify(...)should help
future proof your codebase while the ROS 2 ports are API compatible.This module contains two core functions:arr = numpify(msg, ...)- try to get a numpy object from a messagemsg = msgify(MessageType, arr, ...)- try and convert a numpy object to a messageCurrently supports:sensor_msgs.msg.PointCloud2↔ structurednp.array:data=np.zeros(100,dtype=[('x',np.float32),('y',np.float32),('vectors',np.float32,(3,))])data['x']=np.arange(100)data['y']=data['x']*2data['vectors']=np.arange(100)[:,np.newaxis]msg=ros2_numpy.msgify(PointCloud2,data)data = ros2_numpy.numpify(msg)sensor_msgs.msg.Image↔ 2/3-Dnp.array, similar to the function ofcv_bridge, but without the dependency oncv2nav_msgs.msg.OccupancyGrid↔np.ma.arraygeometry.msg.Vector3↔ 1-Dnp.array.hom=Truegives[x, y, z, 0]geometry.msg.Point↔ 1-Dnp.array.hom=Truegives[x, y, z, 1]geometry.msg.Quaternion↔ 1-Dnp.array,[x, y, z, w]geometry.msg.Transform↔ 4×4np.array, the homogeneous transformation matrixgeometry.msg.Pose↔ 4×4np.array, the homogeneous transformation matrix from the originSupport for more types can be added with:@ros2_numpy.converts_to_numpy(SomeMessageClass)defconvert(my_msg):returnnp.array(...)@ros2_numpy.converts_from_numpy(SomeMessageClass)defconvert(my_array):returnSomeMessageClass(...)Any extra args or kwargs tonumpifyormsgifywill be forwarded to your conversion functionFuture workAdd simple conversions for:geometry_msgs.msg.Inertia
Package: ros2setup
Ros2SetupThis project is a tiny python library made for ROS2 modules to simplify the packaging process.Instead of having two files -setup.pyandpackage.xml- with the same duplicated information, this module makes it easy dynamically import the information from thepackage.xmlinto the python setup file.This way, only thepackage.xmlfile has to be edited, to prevent having the two files with conflicting information.InstallingEither install withpip install ros2setup, or copyros2setup.pynext to yoursetup.pyso that it is accessible from there.UsageIn thesetup.pyfile of your ROS2 package, change the hardcoded information to a call to Ros2Setup to pull the data from the XML file.fromsetuptoolsimportsetupfromros2setupimportRos2Setuppackage_name=Ros2Setup.tag('name')setup(name=package_name,version=Ros2Setup.tag('version'),packages=[package_name],data_files=[('share/ament_index/resource_index/packages',['resource/'+package_name]),('share/'+package_name,['package.xml']),],install_requires=['setuptools'],zip_safe=True,maintainer=Ros2Setup.tag('maintainer'),maintainer_email=Ros2Setup.attrib('maintainer','email'),description=Ros2Setup.tag('description'),license=Ros2Setup.tag('license'),tests_require=['pytest'],entry_points={'console_scripts':['streamer = mypackage.submodule:main',],},)
Package: ros2-system-manager
👨‍💻 ros2_system_managerros2 system manager for your robotMake available in docker shutdown and other system commands directly from ROS2 servicesTest managerdocker run -it --rm --network host -v /run/ros2sm.sock:/run/ros2sm.sock rbonghi/ros2_system_manager:latestDevelopInstall in dev mode the packagesudo -H pip3 install -v -e .Build ros2 packagecolcon build --symlink-installBuild dockerYou can test the docker image build the imagedocker build -t rbonghi/ros2_system_manager:latest .Developdocker run -it --rm --network host -v /run/ros2sm.sock:/run/ros2sm.sock -v $HOME/nanosaur_ws/src/ros2_system_manager:/opt/ros_ws/src/ros2_system_manager rbonghi/ros2_system_manager:latest bashTestTo run a testcolcon test --event-handlers console_cohesion+ --return-code-on-test-failure --packages-select ros2_system_manager
Package: ros2tcp
ros2TCPCreating a bridge between ROS 2 and TCP SocketUSAGEGiven example for using the library is given below.Creating TCP Socket# Import TCP Socketfromros2tcp.TCPsocketimportTCPSocketServer# Create socket instance.server=TCPSocketServer()# Set 'HOST' name and 'PORT'server.HOST='localhost'server.PORT=2040Creating ROS service client# Import required service typefromros2tcp.pluginsimportregister_callback,register_service,register_pluginfromstd_srvs.srvimportSetBool# Create service requestrequest=SetBool.Request()request.data=True# Register service clientsrv_1=register_service(n_name='test_node_1',s_type=SetBool,s_name='test_service',req=request)srv_2=register_service(n_name='test_node_2',s_type=SetBool,s_name='test_service',req=request)# Register callback when response received from the server@register_callbackdefmy_callback_1(data):# 'data' argument is the response received from the ros service.# The data returned here will be send back to the socket client who requested this service.returndata.message@register_callbackdefmy_callback_2(_):# The data returned here will be send back to the socket client who requested this service.return'done'# Now map these service client to the plc request.server.operations=register_plugin(srv=srv_1,cb=my_callback_1,key=1# Whenever socket client sends '1', the 'srv_1' get called.)server.operations=register_plugin(srv=srv_2,cb=my_callback_1,key=1# Whenever socket client sends '3', the 'srv_2' get called.)# NOTE: Currently key should be an integer.Running the Socket# import server runnerfromros2tcp.pluginsimportrun_server# Pass the created socketrun_server(socket=server)
Package: ros2-test-runner
ROS2 Test RunnerThis Python package provides a convenient way to run ROS2 programs multiple times and collect timing and other statistics. It can be used to analyze the performance and behavior of ROS2 systems.FeaturesRun ROS2 files multiple times with customizable parameters.Collect timing statistics such as execution time, latency, and frequency.Easy integration with existing ROS2 workflows.UsageChange the configuration file (config.json) specifying the ROS2 files you want to execute and their parameters. Here's an example:{"packages":[{"name":"panda_moveit_config","launch":"moveit.launch.py","leader":false},{"name":"paper_benchmarks","launch":"benchmark_asynchronous.launch.py","leader":true}],"checkpoint":"<place_your_checkpoint_log_string_here>","terminate":"<place_your_terminate_log_string_here>","pre_commands":["cd /home/ros/ws_moveit ",". install/setup.sh "]}You need to log checkpoint and terminate string from as RCL_INFO.CheckpointWhen the "checkpoint" keyword is encountered in the stdout, the statistics collection process records a timestamp in the statistics collection file, signifying the occurrence of this event.TerminateThe "terminate" keyword is utilized to signal the end of a current run and initiate a new run in the statistics collection process.Then run the runner.pypython3runner.pyAfter execution, you can find the log lines of checkpoints in theexample.txt. It will contain timing statistics.ContributingContributions are welcome! If you encounter any issues or have suggestions for improvement, please open an issue on the project's GitHub repository.ContactFor any inquiries or support, please contact the project maintainer:Tharaka RatnayakeEmail:tharakasachintha27@gmail.comWe hope this package helps you in analyzing and optimizing your ROS2 systems. Happy coding!
Package: rosa
Commands for quickly performing common operations inROS.InstallationTo install, run the following:pip install rosaOr, if you wish to install the latest from source:git clone https://github.com/abencz/rosa
cd rosa
python setup.py installUsage & ExamplesROSA installs a new command (rosa) which includes subcommands for doing
common ROS tasks. And, of course, there’s a--help:rosa --helpCreating a WorkspaceTo create a workspace, source yoursetup.{bash,zsh,sh}of choice from
eitheropt/rosor from an existing workspace if usingoverlays, then run
rosa:source /opt/ros/hydro/setup.bash
rosa create_workspace my_workspaceIf you have a rosintall you’re going to use with this workspace, you can add it
up immidiately using the-iflag. The rosinstall will be merged in to the
workspace (as if usingwstool merge), and updated (wstool update):rosa create_workspace -i ~/my.rosinstall my_workspaceAs withwstoolyou can also use web URIs directly:rosa create_workspace -i http://bit.ly/1xpc6AK my_workspaceSpecify multiple rosinstall files using multiple-iflags:rosa create_workspace -i ~/my.rosinstall -i http://bit.ly/1xpc6AK my_workspaceAdding ROSinstall Files to an Existing WorkspaceYou can also merge rosinstall files into a workspace that already exists. From
anywhere in the target workspace:rosa merge_rosinstall ~/my.rosinstallOnce again, URIs are fair game as are multiple rosinstall files:rosa merge_rosinstall ~/my.rosinstall http://bit.ly/1xpc6AKIf you’re not inside a workspace or you want to merge the rosinstalls into a
different workspace you can specify one using the-wflag:rosa -w ~/my_workspace merge_rosinstall ~/my.rosinstallCreating a ROSinstall File From an Existing WorkspaceIf you’ve been doing dev work in your workspace, often the rosinstall is out of
sync with the packages. Using rosa you can create a rosinstall file from the
current state of your workspace. If you’re currently in a workspace folder,
rosa will look through packages in src and compile a rosinstall that reflects
the currently checked out branches, tags and commits.:rosa generate_rosinstallYou can also specify a workspace manually:rosa -w ~/my_workspace generate_rosinstallIf you want rosa to write the rosinstall to a file instead ofstdoutyou
can provide one to the-oflag:rosa generate_rosinstall -o my_workspace.rosinstallBe aware that currently this command only works with Git repositories and
requires an “origin” remote to be set in order to get a valid URI for the
package.LicenseBSD
Package: rosalie
rosalieA simple simulation tool to compare experiment evaluation methods.InstallationThe package is currently hosted onTest PyPIand can be installed using:python-mpipinstall--index-urlhttps://test.pypi.org/simple/rosalieYou also have to install dependencies if you haven't already (packages on Test PyPI can differ from those on live PyPI, so dependencies cannot be installed automatically):python-mpipinstallaltair
python-mpipinstallnumpy
python-mpipinstallpandas
python-mpipinstalltqdmDeveloper workflowPublished version lives onmain.Development version lives ondev.New features are separate branches offdev.To publish a new feature, merge it intodevfor testing, then merge intomainto publish.For the curiousInThree Little Nuts for Cinderella, "Rosalie" is Cinderella's wise owl friend that helps her make good choices. The hope is that this package will do the same for its users.
Package: rosa-python-client
rosa-python-clientPypi:rosa-python-clientA utility to run ROSA commands in CLIRelease new versionrequirements:Export GitHub tokenexportGITHUB_TOKEN=<your_github_token>release-itsudonpminstall--globalrelease-it
npminstall--save-dev@release-it/bumperNote: execute outside the repository directory (for example~/)usage:To create a new release, run:gitmain
gitpull
release-it# Follow the instructionsKnown Limitations:Although rose cli support args with(space) when using this module we only accept arg=valuerosa cli accept:rosa create cluster --cluster-name myclusterwhen called with this module the command should be:rosa create cluster --cluster-name=mycluster
Package: rosbackup
ROSBackupSummarySimple utility for backing up RouterOS configuration.InstallationCreate backup user accountIt is recommended to create a dedicated user account with limited permissions for backup purposes. This user should have ssh and read permissions. Please checkRouterOs manualif you are not sure how to do this.Installation form PyPI:pip3 install rosbackupDockerYou can download the image from Docker Hub:docker pull mharjac/rosbackupOr build it on your own:docker build -t rosbackup . -f docker/DockerfileCreate a volume for storing backups:docker volume create mikrotik-router-1Create a container:docker run -d --name=mikrotik-router-1 -e ROS_HOST="https://192.168.1.1" -e ROS_USER="backusr" -e ROS_PASS="somesuperstrongpassword" --mount=src=mikrotik-router-1,dst=/backup rosbackup:latestAnd finally, for unattended regular backups, create a cron job which will execute:docker start mikrotik-router-1Install from Snap Storesnap install rosbackupUsageIt can be used as an interactive tool from CLI:rosbackup -H https://192.168.1.1 -u user1 -p passw0rd -f ./backup.cfgWhen used in CLI, it will prompt for password if -p (--password) flag is not provided. Also, without -f (--file) flag, config will be printed to the stdout.It can also be used for unattended backups (e.g., in containers), in which case, it requires following environment variables:ROS_HOST: for storing IP address or hostname (e.g., 192.168.1.1)ROS_USER: username for making backupsROS_PASS: password for provided usernameROS_DELAY: execution delay between commands (optional; required on older devices; default 5)export ROS_HOST="192.168.1.1" ROS_USER="user1" ROS_PASS="passw0rd" ROS_DELAY="3"
rosbackupWhen executed in unattended mode, configuration backup will be saved in execution directory asconfig-{time_stamp}.cfg.
Package: rosbag2-api
How to read bag filesTemporary python API for reading bag files. For more details about the API, see thedocumentation.Installpip3installrosbag2-apiRequirementssqlite3 (sudo apt-get install sqlite3)rclpyCheckout this development versiongitclonehttps://github.com/biospine/reading_rosbag.gitTestpython3testing_reading_rosbag.pyInputThetesting_reading_rosbag.pyscript opens thebag fileand reads data.Expected outputThetesting_reading_rosbag.pyscript saves a .csv file with the same name of the bag file.
Package: rosbag-compare
rosbag-compareCompare the topic content between rosbagsSay you have a bunch of rosbags inside a folder and you don't know whether or not all those rosbags have the same topics.rosbag-comparewill :retrieve the topics contained in each rosbagexport a summary of the ros topics in a JSON fileplot the topics that are missing for each rosbag :Installationrosbag-comparecan be installed from PyPi :$pipinstallrosbag-compareUsagerosbag-comparecan be used both as a command line application and in Python code.Command lineA basic use ofrosbag-compareis to simply call it with the path of the folder that contains rosbags. This will simply generate a JSON file with a summary of the comparison intopics_<name-of-bagfolder>.json.$rosbag-compare-b/path/to/folder/with/rosbagsYou can also generate a figure that will show what topics are missing in each rosbag with the--plot/-pflag. This figure helps when you want to find out if all rosbags of your experiment contains the topics that are of your interest.$rosbag-compare-b/path/to/folder/with/rosbags-pIn PythonYou can also callrosbag-comparedirectly into your Python code :fromrosbag_compareimportRosbagComparatordata_path="/path/to/folder/with/rosbags"rbag_comp=RosbagComparator(data_path)# This step may take time as it open each rosbag separately# Will show a progress barrbag_comp.extract_data()# Export summary to a JSON filerbag_comp.to_json()# Defaults to topics_<foldername>.jsonrbag_comp.to_json("exported_summary.json")# Generate a figure with the name of the# missing topics for each rosbagrbag_comp.plot()# Show figurerbag_comp.plot(save_fig=True)# Save figure (defaults to missing_topics.png)rbag_comp.plot(save_fig=True,img_path="topics_summary.jpg")# Save figure to pathContributingPull requests are welcome and don't hesitate to open issuesDevelopment requirements can be installed using pip :$python-mvenvvenv$sourcevenv/bin/activate$pipinstall-rrequirements/requirements-dev.txtLicenseThis project is licensed under aMITlicense