Git Product home page Git Product logo

rosgo's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rosgo's Issues

gengo produces not correctly formatted files

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.

Plans to add compatibility with ros2?

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

Error in decoding fixed-lenght arrays

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.

Has this been abandoned?

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?

Incorrect node name in default namespace

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

How to use gengo?

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

Md5 checksum

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

If you have another ranging device with different behavior (e.g. a sonar

array), please find or create a different message, since applications

will make fairly laser-specific assumptions about this data

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",
}
)

Generated msg files have self dependencies

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

rosbag cannot record topics published by rosgo

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.

Don't do os.Exit()

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.