akio / rosgo Goto Github PK
View Code? Open in Web Editor NEWPure Go implementation of ROS client library
License: Other
Pure Go implementation of ROS client library
License: Other
I generate message files using gengo
. It creates files which are not correctly formatted from the perspective of go fmt
: idents, spaces, empty lines are not correct. However, my IDE runs go fmt
before commit. This cause the file is always changed after each run of go generate
.
Add CMake script and integrate message generation to Catkin.
In Python we have very good methods in rosnode
package: http://docs.ros.org/hydro/api/rosnode/html/
Technically these are XMLRPC calls to http://wiki.ros.org/ROS/Master_API and http://wiki.ros.org/ROS/Slave_API
In rosgo
XMLRPC connection to ROS master is hidden.
It'll be very useful to have a public wrapper over it repeating methods of Python's rosnode
package.
Recently ros2 added the concept pf ROS Client Libraries (c libs) to develop native nodes in different programming languages.
Maybe the structure of this repository could be used to implement this functionality in go.
Any thoughts?
JJ
Subscriber and Publisher can work only on the same machine. Publisher listen on 172.0.0.1 and send it to subscriber. And if Subscriber run on remote host is fail
It appears as if a fixed length array is encoded without the length prefixed: http://wiki.ros.org/msg#Fields The code does not take care of this fact, and tries to read a length.
I'll try a bit more to fix this tomorrow, but nothing I do seems to work. How am I supposed to regenerate all the messages?
It seems a bit quiet around here. Maybe @cnord has some input? I'm using your fork at the moment.
I don't see work on PRs and issues, the documentation seems outdated, the examples don't compile. Is someone working on it or there's a replacement for a ROS library for go?
Implement Service client.
The calculation of md5 checksum of geometry_msgs/PoseWithCovariance seems wrong. It should be c23e848cf1b7533a8d7c259073a97e6f
according to rosmsg md5
command, but gengo produces 620fbdfad1a8bc89c4d876fdb4ffa7f8
for this. The sums of all child nodes Point
, Quaternion
, Pose
are correct.
If the node is created like this:
node, err := ros.NewNode("nodename", os.Args)
The resulting node name registered on ROS master become "//nodename".
This causes the address of the node cannot be determined correctly and tools like multimaster_fkie cannot sync a master with such node.
$ rosnode list -a
unknown address //nodename
I downloaded gengo to my Ubuntu 20.04 machine, and installed as what I guess is a ros package with catkin_make. How do I use gengo to generate messages, I see comments on source files but that's not working.
fernandob@ros-vbox:/media/sf_ROS/git/rlw-go$ go:generate gengo msg caros/SignalID
go:generate: command not found
Implement service server.
Implement message generator.
We should use go get/install
to install non-ROS library.
Hi
I tried to gengo LaserScan.msg and looks like the md5 from gengo is different from rosmsg md5. The StringMsg seems fine.
dkg@linus:~/Projects/rosgo/test/test_talker/vendor/std_msgs$ rosmsg md5 sensor_msgs/LaserScan
90c7ef2dc6895d81024acba2ac42f369
---------------snippet from LaserScan.go
var (
MsgLaserScan = &_MsgLaserScan {
`# Single scan from a planar laser range-finder
Header header # timestamp in the header is the acquisition time of
# the first ray in the scan.
#
# in frame frame_id, angles are measured around
# the positive Z axis (counterclockwise, if Z is up)
# with zero angle being forward along the x axis
float32 angle_min # start angle of the scan [rad]
float32 angle_max # end angle of the scan [rad]
float32 angle_increment # angular distance between measurements [rad]
float32 time_increment # time between measurements [seconds] - if your scanner
# is moving, this will be used in interpolating position
# of 3d points
float32 scan_time # time between scans [seconds]
float32 range_min # minimum range value [m]
float32 range_max # maximum range value [m]
float32[] ranges # range data [m] (Note: values < range_min or > range_max should be discarded)
float32[] intensities # intensity data [device-specific units]. If your
# device does not provide intensities, please leave
# the array empty.
`,
"sensor_msgs/LaserScan",
"23c73a12c2c55ba75719db68521d4325",
}
)
If I generated geometry_msgs/Twist in my package for example, it will fail to build because golang does not allow import cycles. The Twist.go file also imports geometry_msgs to grab its definitions.
Is there an easy workaround for this? Thank you
ROS Melodic.
I'm trying to rosbag record /bagfiles/disk_usage
where /bagfiles/disk_usage
is a topic of a custom type bafiles/DiskUsage
published using rosgo
.
The rosgo
application prints:
2019/07/16 16:42:00 [DEBUG] Slave API requestTopic(/rosbag_SyKvsmoy, /bagfiles/disk_usage, ...) called.
2019/07/16 16:42:00 [DEBUG] TCPROS requested
2019/07/16 16:42:00 [DEBUG] [TCPROS 172.24.0.1 50834]
2019/07/16 16:42:00 [DEBUG] Connected 172.24.0.3:53490
2019/07/16 16:42:00 [DEBUG] defaultPublisher.listenRemoteSubscriber loop
2019/07/16 16:42:00 [DEBUG] remoteSubscriberSession.start enter
2019/07/16 16:42:00 [DEBUG] TCPROS Connection Header:
2019/07/16 16:42:00 [DEBUG] `callerid` = `/rosbag_SyKvsmoy`
2019/07/16 16:42:00 [DEBUG] `md5sum` = `*`
2019/07/16 16:42:00 [DEBUG] `tcp_nodelay` = `0`
2019/07/16 16:42:00 [DEBUG] `topic` = `/bagfiles/disk_usage`
2019/07/16 16:42:00 [DEBUG] `type` = `*`
2019/07/16 16:42:00 [DEBUG] remoteSubscriberSession.start exit
INFO Disconnected subscriber= topic=/bagfiles/disk_usage
2019/07/16 16:42:00 [ERROR] remoteSubscriberSession &{0xc0001181e8 //bagfiles /bagfiles/disk_usage uint64 size_bytes # disk size in bytes
uint64 used_bytes # disk used space in bytes
uint64 avail_bytes # disk available space in bytes
uint8 avail_percent # disk available space in percent
7858263e4ebcc3dbe66fcc0534a2cf5c bagfiles/DiskUsage 0xc00016a720 0xc000112f60 0xc0002161e0 0xc000126808 0x8a3a50 0x8a3cc0} error: Incomatible message type!
rosbag
subscribes to the topics using the headers type="*"
and md5sum="*"
.
While the rosgo
makes this check during subscription:
if headerMap["type"] != session.typeName || headerMap["md5sum"] != session.md5sum {
panic(errors.New("Incomatible message type!"))
}
Probably, some support for the wildcard "*" type and md5sum should be added.
Current implementation calls logger.Fatalf()
(and os.Exit()
inside) when it's not possible to create objects.
For example:
func (node *defaultNode) NewPublisherWithCallbacks(topic string, msgType MessageType, connectCallback, disconnectCallback func(SingleSubscriberPublisher)) Publisher {
//...
_, err := callRosApi(node.masterUri, "registerPublisher",
node.qualifiedName,
name, msgType.Name(),
node.xmlrpcUri)
if err != nil {
logger.Fatalf("Failed to call registerPublisher(): %s", err)
}
//...
}
The better is to return (Publisher, error)
in this case and involve typical Go error handling mechanics than unconditionally die.
I'm building a service where ROS node can be started later, some functionality of it doesn't depend on ROS. But I cannot start when ROS master is not available because of os.Exit()
in the rosgo
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.